Getting started / 02

A place for your objects.

A library groups named objects. Source physical files contain members; a compiled program is a separate object. This exercise uses a new library named LEARN.

CRTLIB LIB(LEARN) TEXT('Practice workspace')
ADDLIBLE LIB(LEARN)
CRTSRCPF FILE(LEARN/QCBLLESRC) RCDLEN(112)
CRTSRCPF FILE(LEARN/QRPGLESRC) RCDLEN(112)
CRTSRCPF FILE(LEARN/QCLSRC) RCDLEN(112)
DSPLIB LIB(LEARN)

The display lists your three source files. Press F3 to return. If LEARN already exists, skip its creation and continue; a duplicate-object message does not mean your existing work was lost.

Names and the library list

Use qualified names such as LEARN/QCLSRC to be explicit. An unqualified program name is resolved through the job's library list. ADDLIBLE affects this job; another session has its own list. QTEMP belongs to a job and disappears when that job ends.

Object names are usually up to ten uppercase characters. A source file such as QCBLLESRC can hold many members, each containing one program's source.

Ask the system

Type CRTSRCPF and press F4 to inspect its fields and defaults. Press F12 to cancel without creating another file.

Next: write and compile your first programs. Reference: CRTLIB, CRTSRCPF, ADDLIBLE.