Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

RPG Program

Posted on 2008-07-28
15
1,499 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
ID: 22110805
Hi Dude,

What do you think this program will do for you ?

Regards,
Murph
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 22112112
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
ID: 22137648
Can I write the free-format within a RPGL program?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 22138548
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
ID: 22152242
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
ID: 22153180
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
ID: 22153923
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
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 22154756
Hi Dude,

Did you anabled the CF09 key in your DDS source?

Regards,
Murph
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 22154805
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
ID: 22155563
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
ID: 22156236
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
ID: 22161163

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

Author Closing Comment

by:dude02
ID: 31480878
Thanks for all your help.
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 22162355
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Scripting vs. Programming languages 25 179
Adjust the position 3 65
Regular Expression Calculator Tester 2 80
AutoIncrement column based of FK 11 55
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

856 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