Solved

RPG Program

Posted on 2008-07-28
15
1,492 Views
Last Modified: 2013-11-25
I am practicing writing RPG IV programs and I came across an interesting program that I have been trying to get it to work but with no luck. Any ideas will be greatly appreciated. Thanks.

Dude

RPG-IV-program.txt
0
Comment
Question by:dude02
  • 7
  • 7
15 Comments
 
LVL 16

Expert Comment

by:theo kouwenhoven
Comment Utility
Hi Dude,

What do you think this program will do for you ?

Regards,
Murph
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
Comment Utility
A program header will help to start, just informational.

comment lines dont start with // for normal RPG (only for free-format)
Otherwise you have to type a * on pos 7.
This // in non free-format will generate errors

Regards,
Murph
0
 
LVL 4

Author Comment

by:dude02
Comment Utility
Can I write the free-format within a RPGL program?
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
Comment Utility
Hi Dude,

Yes you can but only the C-specs (Calculation part)
Start the first line of the freeformat with /FREE on position 7 (remark, the C is pos. 6)
end the program with /END-FREE   (as already in your example)
every line has to be to end with a semicolon ";"

and (don't forget) the source type must be RPGLE.

Good Luck,
Murph
0
 
LVL 4

Author Comment

by:dude02
Comment Utility
Thanks for all your help. I am getting this error message:
What do I need to do in order to correct the problem. I did double check all entries and they are all correct.
 *...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....0....+....1....+....2....+....3
  5722WDS V5R4M0  060210 RN        IBM ILE RPG             TESTPLG/DATECALCR        S1041135   08/04/08 09:26:10        Page      2
 Line   <---------------------- Source Specifications ----------------------------><---- Comments ----> Do  Page  Change Src Seq    
 Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line  Date   Id  Number
                           S o u r c e   L i s t i n g                                                                              
      1 FDATECALCD CF   E             WORKSTN INDDS(Indicators)                                                   080801     000100
      2  *//-----------------------------------Procedure interfaces                                               080729     000200
         *--------------------------------------------------------------------------------------------*                            
         *                               RPG name         External name                               *                            
         * File name. . . . . . . . . :  DATECALCD        TESTPLG/DATECALCD                           *                            
         * Record format(s) . . . . . :  DATECALC01       DATECALC01                                  *                            
         *                               DATECALC02       DATECALC02                                  *                            
         *--------------------------------------------------------------------------------------------*                            
      3 D DayName         PR             9                                                                        080728     000300
 ======> aaaaaaaaaaaaaaa                                                                                                            
 *RNF3788 30 a      000300  Keyword EXTPGM must be specified when DFTACTGRP(*YES) is                                                
                            specified on the CRTBNDRPG command.                                                                    
      4 D                                 D   VALUE                                                               080728     000400
      5  *//---------------------------------------Indicator data structure                                       080729     000500
      6 D Indicators      DS                                                                                      080728     000600
                                                                                                                                                                                             
0
 
LVL 4

Author Comment

by:dude02
Comment Utility
Ok I found I had to prompt f4 when compling and change the setting: Default activation group . . . .   *YES       to *NO.
                                                             
0
 
LVL 4

Author Comment

by:dude02
Comment Utility
The program seems to work but when I press F9 I get an error message that states invalid key. It should send me back to the main screen. Any ideas?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 16

Expert Comment

by:theo kouwenhoven
Comment Utility
Hi Dude,

Did you anabled the CF09 key in your DDS source?

Regards,
Murph
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
Comment Utility
oop typo  anable = enable :)

A little tip for compiling errors (maybe you are aware of it, but any way):
Open the source for EDIT then press F15  and choos 2 (spoolfiles) and enter.
if you get an error press F4 to select your compiler listing and press enter.

Now you see in the top half of your screen the source, the lower part, the listing
go to the command line of your listing and search there for *ERR
(Type *ERR end press F16)
Now you find the first error and the error in the message line in your screen.
Put your cursor on this message line and press F1 an extended help about this error is shown.

Regards,
Murph
0
 
LVL 4

Author Comment

by:dude02
Comment Utility
Take a look at the code to see if I am missing something that would cause the F9 key not to function correctly. Thanks.
DateCalCR.txt
0
 
LVL 16

Accepted Solution

by:
theo kouwenhoven earned 500 total points
Comment Utility
I can't see it in this source, the F9 key must be specified in your DDS file DATECALCD
in the top part of your DDS source you have to include the next line:

A                                      CF09

A line like that should be there allready if your F10 is working


0
 
LVL 4

Author Comment

by:dude02
Comment Utility

 I was missing CA09(09). Thanks for all your help.
 
0
 
LVL 4

Author Closing Comment

by:dude02
Comment Utility
Thanks for all your help.
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
Comment Utility
Hi Dude,

Consider the Use of CA or CF keys.

CA09 is sending the F9 key to the program
CF09 is sending F9  but also the screen buffer to your program.

Regards,
Murph
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now