Link to home
Start Free TrialLog in
Avatar of dude02
dude02Flag for United States of America

asked on

RPG Program

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
Avatar of Theo Kouwenhoven
Theo Kouwenhoven
Flag of Netherlands image

Hi Dude,

What do you think this program will do for you ?

Regards,
Murph
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
Avatar of dude02

ASKER

Can I write the free-format within a RPGL program?
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
Avatar of dude02

ASKER

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
                                                                                                                                                                                             
Avatar of dude02

ASKER

Ok I found I had to prompt f4 when compling and change the setting: Default activation group . . . .   *YES       to *NO.
                                                             
Avatar of dude02

ASKER

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?
Hi Dude,

Did you anabled the CF09 key in your DDS source?

Regards,
Murph
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
Avatar of dude02

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Theo Kouwenhoven
Theo Kouwenhoven
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dude02

ASKER


 I was missing CA09(09). Thanks for all your help.
 
Avatar of dude02

ASKER

Thanks for all your help.
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