4
STRSEU or F6(Create) from WRKMBRPDM Source type = CLP Source physical file = QCLSRC To create a CL pgm = CRTCLPGM or option 14(Compile) from the WRKMBRDPM. PGM ENDPGM In CL pgm’s we have to use ‘&’ as a prefix to specify it as a variable. Note: no need declare a file (DSPF, PRTF, PF, LF) variable in a CLP programs DCL – to declare a variable Dcl var(&a) type(*dec) len(5 2) value(123.45) Dcl var(&b) type(*char) len(10) value(‘chennai’) Dcl var(&c) type(*lgl) len(1) DCLF – to declare a file. DCLF file(emp) rcdfmt(empr) CHGVAR – to move the value from one variable to another variable and as well as it can convert the numeric value to a character value also. CHGVAR var(&c) value(&a+&b)

CLP400 INTRODCTION

Embed Size (px)

DESCRIPTION

cl introduction

Citation preview

Page 1: CLP400 INTRODCTION

STRSEU or F6(Create) from WRKMBRPDM

Source type = CLP

Source physical file = QCLSRC

To create a CL pgm = CRTCLPGM or option 14(Compile) from the WRKMBRDPM.

PGM

ENDPGM

In CL pgm’s we have to use ‘&’ as a prefix to specify it as a variable.

Note: no need declare a file (DSPF, PRTF, PF, LF) variable in a CLP programs

DCL – to declare a variable

Dcl var(&a) type(*dec) len(5 2) value(123.45)

Dcl var(&b) type(*char) len(10) value(‘chennai’)

Dcl var(&c) type(*lgl) len(1)

DCLF – to declare a file.

DCLF file(emp) rcdfmt(empr)

CHGVAR – to move the value from one variable to another variable and as well as it can convert the numeric value to a character value also.

CHGVAR var(&c) value(&a+&b)

- substraction

* multiplication

/ division

Page 2: CLP400 INTRODCTION

To display some value as a output

SNDPGMMSG msg(‘hi how are you’)

SNDPGMMSG msg(&a)

SNDUSRMSG msg(‘hi how are you’)

Note: these two commands can display only the character values only.

To combine two or more strings into one string (Concatenation)

*CAT

*BCAT

*TCAT

Ctrl+F2

System 34

System 36

System 38

AS400

V5 R4

V6 R1

Page 3: CLP400 INTRODCTION