1 / 10

Using Display files in CLLE and RPGLE

Using Display files in CLLE and RPGLE. Creating commands. Passing Parameters in CLLE. Changes to the PGM statement: pgm parm(&parm1 &parm2 &parm3) PGM statement must exist if parameters are passed Parameters must be declared using DCL. Substring Function (%SST). p gm

lahela
Download Presentation

Using Display files in CLLE and RPGLE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using Display files in CLLE and RPGLE Creating commands

  2. Passing Parameters in CLLE Changes to the PGM statement: pgm parm(&parm1 &parm2 &parm3) PGM statement must exist if parameters are passed Parameters must be declared using DCL

  3. Substring Function (%SST) pgm dcl &field1 *char 10 value(‘2010-02-24’) dcl &field2 *char 4 dcl &field3 *char 2 dcl &field4 *char 2 chgvar &field2 value(%sst(&field1 1 4) chgvar &field3 value(%sst(&field1 6 2) chgvar &field4 value(%sst(&field1 9 2) endpgm

  4. RPG Programming with Database Objects

  5. FSPEC Review File name – name of file File Type – C for a Display file I, U, or O for Database Objects O, for Printer Files (reports) File Format – E for Externally Described Record Address Type – K if the object has a sort Device – Disk for Database Object Workstn for display files Printer for reports

  6. RPG Verbs and Functions • Read filename; • reads a record from a database object • %EOF(filename) • Checks for End of File

  7. Character Strings • Concatenating – use the + eg. field1 = ‘Jane ‘; field2 = ‘Doe ‘; field3 = field1 + field2; What will field3 have in it?

  8. %Trim • Removes trailing and leading spaces from a character string eg. field1 = ‘ IBC233 ‘; field2 = %trim(field1); What will field2 have in it?

  9. Programming tasks • Create a display file that uses all of the fields from the Student file. All of the fields should be output only. Feesowed and Finesowed should have the attribute Reverse Image (RI) conditioned by an indicator. Replace the name fields with a full name field. • Write an RPG program that displays each record in the Student file using the above display file. Feesowed and Finesowed should be displayed in Reverse Image if they are greater than zero.

  10. Pseudo Code Initialize variables Receive information Do while not end of file Display the screen Receive information End of file: exit program

More Related