5
document.doc - 1 - Setting up your CL programming environment and How to start coding CL programs on the AS/400 A CL program is made up of a group of CL commands that instructs the system where to get input, how to process it, and where to place the result. CL programs are compiled into executable objects that can be run by simply calling the executable object name. Create the assignment library if required in your assignment. Make sure it is named as specified in the assignment. From now on the current library or the assignment library will in this document be referred to as the RLIB (for required library). Use the display library list command and verify that the RLIB is in the list and also the current library. If it is missing add it to your library list and if not the current library make it so. Use WRKOBJPDM to view objects in the RLIB. Verify that the physical file QCLSRC is present. If missing create it with the CRTSRCPF command. This file is required to contain your CLP programs source members. QCLSRC is the standard naming convention in the AS/400 world for CLP

Cl Environment v 2IBM CL

Embed Size (px)

DESCRIPTION

Cl Environment v 2IBM CL

Citation preview

Page 1: Cl Environment v 2IBM CL

document.doc- 1 -

Setting up your CL programming environment and How to start coding CL programs on the AS/400

A CL program is made up of a group of CL commands that instructs the system where to get input, how to process it, and where to place the result.

CL programs are compiled into executable objects that can be run by simply calling the executable object name.

Create the assignment library if required in your assignment. Make sure it is named as specified in the assignment.

From now on the current library or the assignment library will in this document be referred to as the RLIB (for required library).

Use the display library list command and verify that the RLIB is in the list and also the current library. If it is missing add it to your library list and if not the current library make it so.

Use WRKOBJPDM to view objects in the RLIB.

Verify that the physical file QCLSRC is present. If missing create it with the CRTSRCPF command. This file is required to contain your CLP programs source members. QCLSRC is the standard naming convention in the AS/400 world for CLP source members. You can invent/assign your own name but for this course we will go with QCLSRC.

Option 12 beside the QCLSRC file on the WRKOBJPDM screen can be used to drill down to the individual members (programs) in this file. Another way to gain access to your program source is to use the command STRPDM and drill down to the members by using the menu options provided or by using the command STRSEU..

When using the editor SEU to enter source CL programs as members of source physical file QCLSRC use F4 for the prompts and enter your library name , the file name (QCLSRC) and the source member is the name of your source program that is being created. Use the naming convention for the program name as specified in the assignment.

Page 2: Cl Environment v 2IBM CL

document.doc- 2 -

You must specify the source type CLP (The source type for a CL program). Then press <ENTER>. Enter CL program source statements on the SEU Edit screen display. CL program source statements are individual CL commands that make up a CL program.

Entering STRSEU and the <enter> key will return you session to the same status as your previous SEU session.

When using the drill down method with the STRPDM command you must use the F6 function key to create a new member in the QCLSRC file.

When you have finished entering the CL source statements, press <F3> to exit. Verify that the parameter value for change/create member is "YES" Press <ENTER>.

After creating a source member, you must create an executable object for your CL program. Use option 14 beside the member in the “Work with members using PDM” list to compile and create the executable object.

Other options available are Use option 2 to edit the source.

Use option 5 to display the source

Other functions available to the user are "USER OPTIONS" entered in front of the source member. These can be used as shortcuts to some CL commands. The following are available

Option – DM to display messages. DSPMSGEA edit object authority.

EDTOBJAUT CD start DFU utility. STRDFU ED grant object authority. GRTOBJAUT JL display job log. DSPJOBLOG WS work submitted job. WRKSBMJOB SP display spool files. DSPSPLF

C call and execute your program. CALL

Different functions are available from within the SEU utility. Some are FIND and REPLACE, Browse, FIND etc. , see the function keys listed.

Page 3: Cl Environment v 2IBM CL

document.doc- 3 -

SEU help is available through the use of the F1 key. The cursor position controls the type of help. Command line help is available by placing the cursor on the command line and pressing F1.

Source edit line help can be obtained by placing the cursor on the sequence number of the source line and pressing F1

Use the command DSPMSG to check if your compilation was successful. - Compile errors?

Issuing the command WRKMBRPDM Use option 2 to EDIT your source member again

- Compile successfully? You can run your program using the command CALL .

*****************************************************Look up the SEU, PDM manuals and books at www.as400.ibm.com Use the Library, click on "online library" where you can choose a language. The next step is to look for V4R4 books and manuals. Search or view all V4R4 books and find Program Development Manager Tools such as SEU, PDM, DFU……

Use the PDM utility to assist you with most of the programming activities. Use DSPLIBL to verify that the RLIB library is your library list. If it

is missing add it with the ADDLIBLE command. Make the RLIB library the current library with the CHGCURLIB command. The RLIB library name should be as specified in the assignment or your OPS400 AS/400 User ID.

Use SEU (F6 Create) to create a member of type CL. It is very important that your member be of type CL (i.e. CONTROL LANGUAGE) so the AS/400 can help you with TYPE sensitive editing, compiling or running of your programs.