Measures Concepts
GitHub icon

IBM i Control Language

IBM i Control Language - Programming language

< >

IBM i Control Language is a programming language created in 1993.

#1478on PLDB 31Years Old

The IBM i Control Language (CL) is a scripting language for the IBM's IBM i platform (previously called OS/400 when running on AS/400 systems) bearing a resemblance to the IBM Job Control Language and consisting of an ever-expanding set of command objects (*CMD) used to invoke traditional AS/400 programs and/or get help on what those programs do. CL can also be used to create CL programs (congruent to shell scripts) where there are additional commands that provide program-like functionality (IF/ELSE, variable declaration, file input, etc.) Although CL is a scripting language for system administration, it is used mainly to create compiled programs. The use of interpreted CL scripts through the SBMDBJOB command is in fact extremely limited. Read more on Wikipedia...


Example from Wikipedia:
PGM (&IN &TYP) DCL &IN *CHAR 6 DCL &OUT *CHAR 8 DCL &TYP *CHAR 1 IF (&TYP = J) + DO CVTDAT DATE(&IN) TOVAR(&OUT) FROMFMT(*MDY) + TOFMT(*JUL) TOSEP(*NONE) ENDDO ELSE IF (&TYP = M) + DO CVTDAT DATE(&IN) TOVAR(&OUT) FROMFMT(*JUL) + TOFMT(*MDY) TOSEP(*NONE) ENDDO SNDPGMMSG MSG('IN=' || &IN || ' OUT=' || &OUT) + MSGTYPE(*COMP) ENDPGM

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Day 605 feedback@pldb.io Logout