Creating an RPG Program



Create an RPGLE source member named HELLOWORLD with the following code:

. H DFTACTGRP(*NO) FHELLOWORLDCF E WORKSTN Handler('PROFOUNDUI(HANDLER)') F ExtFile('MYLIBRARY/HELLOWORLD') /Free ExFmt HELLO; *InLr = *On; /End-Free

The code explained:

  • DFTACTGRP(*NO) is required for all Profound UI programs.

  • F spec for HELLOWORLD declares the Rich Display File™.

  • Handler('PROFOUNDUI(HANDLER)') enables RPG Open Access and identifies Profound UI as the RPG OA handler

  • ExtFile('MYLIBRARY/HELLOWORLD') qualifies the display file, specifying the library that contains the file.  Change this to the library used when you saved and compiled your display, or alternatively, remove the ExtFile keyword, and create a CL program to set the appropriate library list and then call the HELLOWORLD program. For example, the CL Program may look something like this:

START: PGM ADDLIBLE LIB(PUISAMPLES) MONMSG MSGID(CPF0000) CALL PGM(HELLOWORLD) END: ENDPGM
  • ExFmt HELLO displays the screen with the record format name HELLO.  We created this screen when we built the display file in the visual designer.