Solved

RPG Program

Posted on 2008-07-28
1,476 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
Question by:dude02
    14 Comments
     
    LVL 16

    Expert Comment

    by:theo kouwenhoven
    Hi Dude,

    What do you think this program will do for you ?

    Regards,
    Murph
    0
     
    LVL 16

    Expert Comment

    by:theo kouwenhoven
    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
    Can I write the free-format within a RPGL program?
    0
     
    LVL 16

    Expert Comment

    by:theo kouwenhoven
    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
    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
    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
    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
    Hi Dude,

    Did you anabled the CF09 key in your DDS source?

    Regards,
    Murph
    0
     
    LVL 16

    Expert Comment

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

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

    Author Closing Comment

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

    Expert Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    This article will show, step by step, how to integrate R code into a R Sweave document
    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 …
    This video teaches viewers about errors in exception handling.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    690 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

    26 Experts available now in Live!

    Get 1:1 Help Now