Getting started / 03
Three languages. One system.
First complete the workspace setup. For each example, open its source file with WRKMBRPDM, press F6, enter the member name and source type, and press Enter to open the editor. Use an I line command to insert lines, then type the source. Press F3 and confirm saving with Enter. See the PDM guide for editor controls.
COBOL
Run WRKMBRPDM FILE(LEARN/QCBLLESRC). Create member HELLOCB with type CBLLE.
Preserve the seven leading spaces in this fixed-format example.
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLOCB.
PROCEDURE DIVISION.
DISPLAY 'HELLO FROM COBOL'.
GOBACK.
CRTBNDCBL PGM(LEARN/HELLOCB) SRCFILE(LEARN/QCBLLESRC) SRCMBR(HELLOCB)
CALL PGM(LEARN/HELLOCB)
The output viewer shows HELLO FROM COBOL. Press F3 to return.
RPG IV
Run WRKMBRPDM FILE(LEARN/QRPGLESRC). Create member HELLORPG with type RPGLE.
**FREE
dsply 'HELLO FROM RPG';
*inlr = *on;
CRTBNDRPG PGM(LEARN/HELLORPG) SRCFILE(LEARN/QRPGLESRC) SRCMBR(HELLORPG)
CALL PGM(LEARN/HELLORPG)
The message/output contains HELLO FROM RPG.
CL
Run WRKMBRPDM FILE(LEARN/QCLSRC). Create member HELLOCL with type CLLE.
PGM
SNDPGMMSG MSG('HELLO FROM CL')
ENDPGM
CRTBNDCL PGM(LEARN/HELLOCL) SRCFILE(LEARN/QCLSRC) SRCMBR(HELLOCL)
CALL PGM(LEARN/HELLOCL)
HELLO FROM CL appears in your job's messages. DSPJOBLOG shows the job log.
When compilation fails
Read the completion/escape message, then inspect DSPJOBLOG and WRKSPLF
for a compiler listing. Check the member source type and the source file/member specified in the command.
Correct the source, save it, and compile again. Source edits do not change the compiled program until you recompile.