ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

first rpg program blowing up

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • first rpg program blowing up

    I think it is because of the printer file but I am not sure. Any help would be appreciated. I work with this over at innovative! I am obviously a newbie and I am doing some self paced lessons. I used to do RPG II so I have some understanding but not a lot.
    Thanks again!

    Sincerely,
    Mark

    Code:
    0001.00  *..1....+....2....+....3....+....4....+....5....+....6....+..
    0002.00  ******************************************************       
    0003.00  *  INPUT SPECIFICATIONS                              *       
    0004.00  ******************************************************       
    0005.00                                                               
    0006.00 FSALESMAST IF   F   63        DISK                            
    0007.00 FQPRINT    O    F  132        PRINTER                         
    0008.00 ISALESMAST NS                                                 
    0009.00 I                                  1    4 0SLSPNUMBER         
    0010.00 I                                  5   34  SLSPNAME           
    0011.00 I                                 35   50  ITEMNUMBER         
    0012.00 I                                 51   56 0DATEOFSALE         
    0013.00 I                                 57   63 2SALEPRICE          
    0014.00                                                               
    0015.00  ******************************************************       
    0016.00  *  CALCULATION SPECIFICATIONS                        *       
    0017.00  ******************************************************
    0018.00                                                        
    0019.00  /FREE                                                 
    0020.00                                                        
    0021.00         EXCEPT HEADINGS;                               
    0022.00         READ SALESMAST;                                
    0023.00         DOW NOT %EOF(SALESMAST);                       
    0024.00           EXCEPT DETAIL;                               
    0025.00           READ SALESMAST;                              
    0026.00         ENDDO;                                         
    0027.00                                                        
    0028.00         *INLR = *ON;                                   
    0029.00         RETURN;                                        
    0030.00                                                        
    0031.00  /END-FREE                                             
    0032.00                                                        
    0033.00  ******************************************************
    0034.00  *  OUTPUT SPECIFICATIONS                             *
    0035.00  ******************************************************              
    0036.00                                                                      
    0037.00 OQPRINT    E            HEADINGS       2  2                          
    0038.00 O                                            8 'PAGE:'               
    0039.00 O                       PAGE                13                       
    0040.00 O                                           50 'WEEKLY SALES REPORT' 
    0041.00 O                                           66 'DATE:'               
    0042.00 O                       *DATE         Y     75                       
    0043.00 O          E            HEADINGS       1                             
    0044.00 O                                           48 'DATE OF SALE' 
    0045.00 O                                           77 'SALE'         
    0046.00 O          E            HEADINGS       2                      
    0047.00 O                                           21 'NAME'         
    0048.00 O                                           48 'NO.'          
    0049.00 O                                           61 'ITEM SOLD'    
    0050.00 O                                           77 'PRICE'        
    0051.00 O          E            DETAIL      1                         
    0052.00 O                       DATEOFSALE    Y     47                
    0053.00 O                       SALEPRICE     1     92                          
            ****************** End of data ****************************************

  • #2
    Re: first rpg program blowing up

    Code:
    FSALESMAST IP   F   63        DISK
    !primary file

    & remove *inlr & return statements

    Comment


    • #3
      Re: first rpg program blowing up

      & say where is the exactly blowing / whatz the error u have

      Comment


      • #4
        Re: first rpg program blowing up

        Originally posted by dhanuxp View Post
        Code:
        FSALESMAST IP   F   63        DISK
        !primary file

        & remove *inlr & return statements
        The book said to make it full procedural file here is what I get when I make it a primary file!
        *RNF5276 30 22 002200 The specified Factor 2 entry is not allowed for REA
        operation; specification is ignored.
        *RNF5276 30 25 002500 The specified Factor 2 entry is not allowed for REA
        operation; specification is ignored.
        *RNF7086 00 6 000600 RPG handles blocking for file SALESMAST. INFDS is u
        only when blocks of data are transferred.
        * * * * * E N D O F A D D I T I O N A L D I A G N O S T I C M E S S

        Comment


        • #5
          Re: first rpg program blowing up

          sorry, when u set it as primary doesnt need to put
          Code:
          DOW NOT %EOF(SALESMAST);                       
          READ SALESMAST;
          try again with
          Code:
          /free  
               // heading u have to control as u want
                // EXCEPT HEADINGS;                               
                                        
                  // this is only statement 
                 EXCEPT DETAIL;                               
                                    
          /end-free
          Last edited by dhanuxp; August 24, 2008, 10:31 PM.

          Comment


          • #6
            Re: first rpg program blowing up

            Originally posted by dhanuxp View Post
            & say where is the exactly blowing / whatz the error u have
            I put it back to full procdural because atleast I get a clean compile that way! Then I had to put the other stuff in also or it doesn't know how to end.

            With a clean compile severity level 00
            I get the following error:
            Job 146485/JONESM/QPADEV0028 started on 08/24/08 at 22:54:55 in subsystem QI
            Error message CPF4101 appeared during OPEN for file SALESMAST (C S D F).

            Press F1 on error line and I get:
            Message ID . . . . . . : RNQ1216
            Date sent . . . . . . : 08/24/08 Time sent . . . . . . : 23:10:11

            Message . . . . : Error message CPF4101 appeared during OPEN for file
            SALESMAST (C S D F).

            Cause . . . . . : RPG procedure RP2EX101 in program JONESM/RP2EX101 received
            the message CPF4101 while performing an implicit OPEN operation on file
            SALESMAST. The actual file is SALESMAST.
            Recovery . . . : Check the job log for a complete description of message
            CPF4101, and contact the person responsible for program maintenance. If the
            file has a device type of SPECIAL, there may be no message in the job log.
            Possible choices for replying to message . . . . . . . . . . . . . . . :
            D -- Obtain RPG formatted printout of system storage.
            S -- Obtain printout of system storage.
            F -- Obtain full formatted printout of system storage.
            More...

            Comment


            • #7
              Re: first rpg program blowing up

              Originally posted by dhanuxp View Post
              sorry, when u set it as primary doesnt need to put
              Code:
              DOW NOT %EOF(SALESMAST);                       
              READ SALESMAST;
              try again with
              Code:
              /free  
                   // heading u have to control as u want
                    // EXCEPT HEADINGS;                               
                                            
                      // this is only statement 
                     EXCEPT DETAIL;                               
                                        
              /end-free
              Errors after putting code like you say:
              *RNF2318 00 1 No overflow indicator is specified; indicator assigned and
              automatic skip to 06 generated.
              *RNF7031 00 3 The name or indicator is not referenced.
              *RNF7086 00 1 RPG handles blocking for the file. INFDS is updated only wh
              blocks of data are transferred.
              *RNF7023 40 1 The Compiler cannot determine how the program can end.

              Comment


              • #8
                Re: first rpg program blowing up

                Originally posted by Mark0720 View Post
                Errors after putting code like you say:

                *RNF7023 40 1 The Compiler cannot determine how the program can end.
                i feel again u set fullprocedure file - set it as primary file

                Comment


                • #9
                  Re: first rpg program blowing up

                  &
                  Code:
                  No overflow indicator is specified; indicator assigned and 
                  automatic skip to 06 generated.
                  where is the overflow indicator for printer file ( i didnt use O spec)

                  Code:
                  FQPRINT    O    F  132        PRINTER     oflind(ovrflw)
                  ovrflw is name indicator to control ur heading
                  for O spec i think, it may like this oflind(*In99) then u can control heading
                  Last edited by dhanuxp; August 24, 2008, 11:07 PM.

                  Comment


                  • #10
                    Re: first rpg program blowing up

                    Maybe you can send a simple program apparently you don't have to use output specs if you don't use them. I used to do this a long time ago. It is having a problem opening my file from the book. I could have made it wrong it is just a flat file 63 bytes I put one record in it.

                    I don't know the goof tutorial is half written then I saw some free form and started winging it!!!

                    I am tired of it now so I am signing off for the night been at it most of the day! It will come to me sooner or later.

                    I sure appreciate you taking your valuable time and helping me!!!

                    Thank you so much!!

                    Sincerely,
                    Mark

                    Comment


                    • #11
                      Re: first rpg program blowing up

                      Originally posted by Mark0720 View Post
                      I put it back to full procdural because atleast I get a clean compile that way! Then I had to put the other stuff in also or it doesn't know how to end.

                      With a clean compile severity level 00
                      I get the following error:
                      Job 146485/JONESM/QPADEV0028 started on 08/24/08 at 22:54:55 in subsystem QI
                      Error message CPF4101 appeared during OPEN for file SALESMAST (C S D F).
                      ...
                      i hope to catch programe error !! code is OK!!

                      problem is :
                      ur file is not in a library list !!

                      Comment


                      • #12
                        Re: first rpg program blowing up

                        Are you saying that the original source is ok?

                        The data file is not being located by the PGM because of its placement within my library.

                        I have a LIBRARY in that library I have objects:
                        QCBLLESRC
                        QRPGLESRC
                        QCL???
                        The file salesmast file I created is in my library...being very new to this AS400 stuff I can only descibe it like this.
                        Code:
                        MYLIBRARY
                            THE PROGRAM FILE
                            THE DATA FILE
                            QCBLLESRC
                            QRPGLESRC
                            QCLSRC or whateve and a few other objects within my LIBRARY
                        I run the program interactive from the command line by typing:
                        CALL (MYLIBRARY/PROGRAMNAME)

                        Being the system is down for backups I can't get anymore specifics than that. I do know that if I do an DSPLIBL or EDTLIBL MYLIBRARY is there.

                        So is there something more I need to do to make my data file available to the program. I mean seriously they are right next to each other as objects in what I would call the "root" of MYLIBRARY.

                        I am like I say very new to this and don't quite understand the concept of how programs know how to find the file they want to work with!

                        I am an HP3000 convert that knows that system very well and if I were going to do the same thing on that system I would have to make what they call file equates meaning:
                        FILE SALESMAST=SALESMAST.MYGROUP.MYACCOUNT

                        Where SALESMAST is the data file
                        MYGROUP would be the object
                        MYACCOUNT would be the Library
                        I hope that make some sort of sense!!!

                        Again, I thank you sincerely for taking the time to help this old dog learn a new trick! If it were not for the kindness of you and the other folks on this forum and the really cool folks over at INNOVATIVE I would not be able to try and better my career. I have had one contract job on the AS400 and I was fortunate enough to get a IT Director that didn't care that I didn't know the AS400 he wanted a very good COBOL programmer which I am. So after getting my feet we and having a background in HP3000 RPG which is RPG II. I have a very strong desire to learn this and write some applications. I still have a lot to learn as far as Data Definitions and all that. It was even kind of hard to make the flat fixed length file at first because I had to search and find the syntax. Which if I remember correct was CRTPF (MYLIBRARY/SALESMAST) RCDLEN(63) that is from what I think I did. I didn't specify that it was a data file but I was able to put a record in it I don't remember what I used but I was prompted for the record on a line near the top of the page that was an underline that took only the 63 bytes of information!

                        I do know after looking around for the CRTPF syntax I may have used, that I definitely didn't use the filetype option! Could that be my problem? Should I have used FILETYPE(*DATA)?

                        I hope this gives you an idea of what/who you are dealing with!!! Again I appreciate your help tremendously!!!!

                        Mark
                        Last edited by Mark0720; August 25, 2008, 12:48 AM.

                        Comment


                        • #13
                          Re: first rpg program blowing up

                          Should I have used FILETYPE(*DATA)? yes

                          With this command just chk SALESMAST file exsist or not
                          WRKF FILE(*LIBL/SALESMAST) - if not

                          to add lib to liblist
                          ADDLIBLE LIB(YOURLIB)

                          YOURLIB = where the SALESMAST File u created
                          Last edited by dhanuxp; August 25, 2008, 02:12 AM.

                          Comment


                          • #14
                            Re: first rpg program blowing up

                            Ok thank you I will try that first thing in the morning when the backups are done and I can get back on the system!!!

                            Again thanks so much for all your time and patience!!

                            Sincerely,
                            Mark

                            Comment


                            • #15
                              It works great now...Thanks!!!!

                              Duh, dumbmeister here....I created the physical data file and I gave it the wrong name "salesmstr" is what I gave it and it was supposed to be "salesmast"!

                              But hey it works!!! Just the way I wrote it the first time! If only I didn't have to rely on tutorials and could actually make my own system!!!

                              It takes time I know, I will be better soon! I really like that /Free style of RPG programming!!!

                              Thanks again for all of your help. Oh by the way my library was there it was just the stupidity of a noob and two different names!

                              I appreciate all of your help!

                              Sincerely,
                              Mark

                              Comment

                              Working...
                              X