P. 1
5th Chapter 5 - C L Programming

5th Chapter 5 - C L Programming

|Views: 257|Likes:
Published by oharamaty

More info:

Published by: oharamaty on Feb 03, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PPT, PDF, TXT or read online from Scribd
See more
See less

11/14/2011

pdf

text

original

Sections

  • Creating CL Programs
  • Programs
  • Program Processing
  • CL Command Syntax
  • Continuing a CL Command
  • CL Programs
  • User Supplied Program Data
  • Program Variables
  • CL Program Variables
  • Retrieving Data from IBM i
  • Sending Data to a User
  • Compilations
  • Verifying in RDi
  • Compilation Reports
  • General information area
  • Searching the report
  • Find Area
  • Source Code Listing
  • Cross Reference table
  • Error Message Summary
  • Run Time Errors
  • 5250 Run Time Errors
  • RDi Run Time Errors
  • Monitoring for Messages
  • Defining a Subroutine
  • Error Handling Routines
  • Creating CL Commands
  • Creating a CL Command
  • Prompt Screen
  • Prompt Screen Example
  • Prompt Screens
  • PARM command
  • Prompt Screen Source Example
  • Creating the command - CRTCMD
  • Points to Remember

Introduction to IBM i

CL Programming

1 Copyright 2009 by Janson Industries

Objectives 

Explain general programming concepts Explain CL¶s strengths and weaknesses as a programming language Show how to create a CL program Explain what a compilation report is and how to use it to find program errors
2   

Copyright 2009 by Janson Industries

Creating CL Programs
Library

Programmer CL Commands LPEX SEU
Copyright 2009 by Janson Industries

PF-SRC

CRTMBR *PGM CLP Compile

CRTMBR CLP
3

CL commands (instructions) can span many lines 4    Copyright 2009 by Janson Industries . Each statement/line in a member is assigned a statement/line number.Programs  Programs are comprised of many programming language instructions Instructions are written on lines or statements.

I. in statement number order Execution can also be conditional and iterative.Program Processing  Programs can execute instructions 3 ways The default method is sequential.   5 Copyright 2009 by Janson Industries .e.

CL Command Syntax  The format for a CL Command is: PARAMETER PARAMETER «. COMMAND  There is at least one space between the:    Command First parameter Each succeeding parameter  Commands are continued from one line to another by placing a plus sign after the command or a parameter 6 Copyright 2009 by Janson Industries .

CL Command Syntax  The + must be preceded by at least a space if the continuation is between: A command and a parameter  Two parameters COMMAND + PARAMETER PARAMETER COMMAND+ PARAMETER PARAMETER COMMAND PARAMETER PARAMETER + PARAMETER PARAMETER + PARAMETER COMMAND PARAMETER PARAMETER+ PARAMETER PARAMETER Copyright 2009 by Janson Industries 7 .

Continuing a CL Command  The + is not preceded by space(s) if the continuation is in the middle of the:  Command word  Parameter keyword COMM+ AND PARAMETER PARMETER COMMAND PARAMETER PARA+ METER COMM + AND PARAMETER PARMETER COMMAND PARAMETER PARA + METER 8 Copyright 2009 by Janson Industries .

Continuing a CL Command  If a parameter value(s) allows spaces. then the + is preceded by space(s) GRTOBJAUT OBJ(YOURLIBXX/CLSRC) OBJTYPE(*FILE) + USER(INTRO35) AUT(*OBJALTER *OBJEXIST + *OBJMGT *OBJOPR *OBJREF *ADD) SNDMSG MSG('The rain in Spain falls manely on the + lions.') TOUSR(INTRO99) 9 Copyright 2009 by Janson Industries .

Continuing a CL Command  If the continuation is in the middle of a value. no spaces precede the + GRTOBJAUT OBJ(YOURLIBXX/CLSRC) OBJTYPE(*FILE) + USER(INTRO35) AUT(*OBJALTER *OB+ JEXIST *OBJMGT *OBJOPR *OBJREF *ADD) GRTOBJAUT OBJ(YOURLIBXX/CLSRC) OBJTYPE(*FILE) + USER(INTRO35) AUT(*OBJALTER *OB + JEXIST *OBJMGT *OBJOPR *OBJREF *ADD) 10 Copyright 2009 by Janson Industries .

CL Programs  Begin with a PGM command and end with an ENDPGM command Comments (non-executable text) may precede the PGM statement Comments begin with a forward slash & an asterisk and end with an asterisk & a forward slash   /* This is an example of a comment. */ 11 Copyright 2009 by Janson Industries .

a printer or a workstation Data Program Data Printout Operating System Storage Copyright 2009 by Janson Industries Data Data User 12 . or the person who calls the program Programs can write data to storage. the OS.Programs    Programs read and write data Data can come from storage.

The PARM keyword identifies the program variables that will hold the data PARM(&CUSTNAME &ORDAMT) 13 CALL pgm1 (µchardata¶ numeric µchardata¶«.User Supplied Program Data  You can supply data when calling the program as follows: To receive the data.)   PGM Copyright 2009 by Janson Industries . the program must have a PARM keyword in the PGM statement.

14 Copyright 2009 by Janson Industries .User Supplied Program Data  The parameters specified on the call must match the parameters specified in the PARM keyword CALL pgm1 (µWalmart¶ 275) PGM  PARM(&CUSTNAME &ORDAMT) If they don¶t match: CALL pgm1 (275) The program will not be run and you will get the following message: Parameters passed on CALL do not match those required.

a program variable has a:     Name Length Data type  Program variables exist for as long as the program is running 15 Copyright 2009 by Janson Industries .Program Variables  Programs store input and output in program variables Just like a data base field.

CL Program Variables   Are defined with a DCL (declare) command A CL program variable name must:    Begin with an ampersand (&) Has a max length of 11 Cannot contain spaces  DCL statements must be at the beginning of the program following the PGM statement PARM(&CUSTNAME &ORDAMT) VAR(&CUSTNAME) TYPE(*CHAR) LEN(15) VAR(&ORDAMT) TYPE(*DEC) LEN(9 2) 16 000100 000200 000300 PGM DCL DCL Copyright 2009 by Janson Industries .

retrieves and stores job information in program variables: Job name User running job Output queue RTVJOBA USER(&USERID) 17 Copyright 2009 by Janson Industries .retrieves and stores system parameter values in program variables: Date Time System Default Printer RTVSYSVAL  SYSVAL(QTIME) RTNVAR(&CURTIME) RTVJOBA .Retrieving Data from IBM i  RTVSYSVAL .

sends a message to the person running the program or a specified users message queue MSG('I''ll be back') MSG(&CUSTNAME) MSGTYPE(*INFO) + TOUSR(INTRO99) SNDUSRMSG SNDUSRMSG  You can build complex messages combining static text and program variables by using string functions 18 Copyright 2009 by Janson Industries .Sending Data to a User  SNDUSRMSG .

joins two strings together  *CAT  *TCAT  *BCAT .String Functions  Concatenation .one trailing space between strings ¶ *CAT &CURTIME) ¶ *TCAT &CURTIME) ¶ *BCAT &CURTIME) SNDUSRMSG SNDUSRMSG SNDUSRMSG  MSG('I''ll be back at MSG('I''ll be back at MSG('I''ll be back at Results in: I'll be back at 14:09:08 I'll be back at14:09:08 I'll be back at 14:09:08 19 Copyright 2009 by Janson Industries .eliminates trailing spaces .

CHGVAR VAR(&NOSECTIME) VALUE(%SST(&CURTIME 1 5) SNDUSRMSG MSG('I''ll be back at  ¶ *BCAT &NOSECTIME) Results in: I'll be back at 14:09 20 Copyright 2009 by Janson Industries . new strings can be created.identifies a subset of a string  %SST(string start-location size)  When used with a CHGVAR command.String Functions  Substring .

CL Program 000100 000200 000300 000400 000500 000600 000700 000800 000900 001000 001100 001200 001300 001400 001500 001600 001700 001800 001900 002000 002100 002200 START: PGM PARM(&LIBNAME &FILENAME &MEMNAME &MEMTYPE) /* Create info is supplied and the variables defined*/ DCL DCL DCL DCL VAR(&FILENAME) VAR(&MEMNAME) VAR(&LIBNAME) VAR(&MEMTYPE) TYPE(*CHAR) TYPE(*CHAR) TYPE(*CHAR) TYPE(*CHAR) LEN(10) LEN(10) LEN(10) LEN(3) */ + + /* The member is created CRTMBR: STRSEU SRCFILE(&LIBNAME/&FILENAME) SRCMBR(&MEMNAME) TYPE(&MEMTYPE) /* Message to confirm member creation is sent SNDUSRMSG MSG('IT''S DONE. PAPPY!') */ /* The program is ended END: ENDPGM */ 21 Copyright 2009 by Janson Industries .

Compilations Library PF-SRC CRTMBR *PGM CLP MSGQ Compilation Report CRTMBR CLP Compile 22 Copyright 2009 by Janson Industries .

RDi Unsuccessful Compilations Library PF-SRC CRTMBR *PGM CLP EVFEVENT *FILE PF-DTA CRTMBR CLP Compile CRTMBR ___ 23 Copyright 2009 by Janson Industries .

RDi Unsuccessful Compilations  The EVFEVENT member will be displayed in Error List  Error msgs displayed in Commands log 24 Copyright 2009 by Janson Industries .

Verifying in RDi  Does everything compiling does except create the object Why bother?     To compile you must be able to communicate to the IPS Verifying doesn't require communicating to the IPS Verifying faster than compiling  No verifier for CL programs!! 25 Copyright 2009 by Janson Industries .

26 Copyright 2009 by Janson Industries .

Compilation Reports  In a spool file with the same name as member Can be viewed  Using  Navigator's Viewer  WRKSPLF 27 Copyright 2009 by Janson Industries .

Display spool files and double click the spool file 28 Copyright 2009 by Janson Industries .

29 Copyright 2009 by Janson Industries .

2. 1=Send 2=Change 3=Hold 4=Delete 5=Display 8=Attributes 9=Work with printing status 6=Release 7=Messages Opt 5 File TESTPGM TESTPGM QPJOBLOG TESTPGM QPJOBLOG TESTPGM QPJOBLOG User USFL1AD001 USFL1AD001 USFL1AD001 USFL1AD001 USFL1AD001 USFL1AD001 USFL1AD001 Device or Queue PRT01 PRT01 QEZJOBLOG PRT01 QEZJOBLOG PRT01 QEZJOBLOG User Data TESTPGM TESTPGM QDFTJOBD Sts RDY RDY RDY RDY RDY RDY RDY Total Pages 4 4 1 4 1 4 1 Cur Page Copy 1 1 1 1 1 1 1 Bottom Parameters for options 1. press Enter. 3 or command ===> F3=Exit F10=View 4 F11=View 2 F12=Cancel F22=Printers F24=More keys 30 Copyright 2009 by Janson Industries .WRKSPLF Work with All Spooled Files Type options.

Compilation Reports  General Information Source Code Listing Cross reference table Error message summary    31 Copyright 2009 by Janson Industries .

. . : *LIBCRTAUT Sort sequence .. .. . . .+. . . . : GRADES Source member name . . : GRADES Library . . . . . . . . ... . . .. . . ______________________________ *.. . . .. . . .5... .. . . . 5763SS1 V6R1M0 100517 Control Language GRA Program . . .+. . . . . . . . .+. . . . . ... . .. . . . : *HEX Language identifier .. .. . . . . .. . : *JOBRUN 32 Copyright 2009 by Janson Industries . . : COMPILEEX 10/30/09 17:06: Source printing options ... .. .+. . .. .. . . .. .. .. .. . ________ Columns 1 . : *YES Replace program . . ... . .+. . . .. ..+. : *YES Target release . .1. ..General information area Display Spooled File File . . . . . . . . . . .. . .. . . .. . . . . ..+. .. .. . . . : *USER Program logging .2. . . . . . . ... : GRADES Source file . . . .3. . : *SOURCE *XREF *GEN *NOSE Program generation options . . : COMPILEEX Page/Line 1/1 Control . . .. . . . . . .78 Find . . : COMPILEEX Library . . . . . . . . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . .7. . . . . . . . . . . . . . . . .. . : *NOLIST *NOXREF *NOPATCH User profile . . . . . . . . .. : V6R2M0 Authority .6. ... .+. .4. . . : *JOB Allow RTVCLSRC command . . . . . . . . . . . . . . . . .. . . . . . . . . . . .

Searching the report  Control field commands provide quick movement through the spool file M ove M ove M ove M ove M ove M ove M ove M ove M ove M ove forward 5 pages backwards 5 pages to page 5 forward 5 lines backwards 5 lines to the right 5 columns to the left 5 columns to the fifth column to the end of the spool file to the beginning of the spool file P+5 P-5 P5 +5 -5 W +5 W -5 W5 B or *BOT T or *TOP 33 Copyright 2009 by Janson Industries .

Find Area  Allows you to search for a character string within the compilation report Case sensitive To find a string:  Enter   the text in the find area  Press F16  To find other occurrences of the string continue to press F16 34 Copyright 2009 by Janson Industries .

+.. 800GOTO CMDLBL(END) * CPD0725 10 End of source file reached without ENDPGM command. 1 .+......Source Code Listing   Displays source code Error messages placed after incorrect statements Control Language Source SEQNBR *.. 200DCL VAR(&USR) TYPE(*CHAR) LEN(10) 300RTVJOBA JOB(&JOB) * CPD0784 30 Variable &JOB for parameter JOB must be *CHAR..+... * CPD0727 40 Variable '&USER ' is referred to but not declared.. 2 .+.. 3 . 5 ....+. 100DCL VAR(&JOB) TYPE(*CHAR) LEN(7) * CPD0740 10 PGM command missing. * * * ** E N D O F S O U R C E * * * * 35 Copyright 2009 by Janson Industries ...+. minimum length 10 400RTVJOBA USER(&USER) * CPD0727 40 Variable '&USER ' is referred to but not declared. 4 .+.') TOUSR(&USER) * CPD0727 40 Variable '&USER ' is referred to but not declared.. 500SNDUSRMSG MSG('The job number is' *cat &job *cat + 600 'and the user is ' *cat &user *cat + 700 '........ 6 ....

36 Copyright 2009 by Janson Industries .Error messages  Comprised of three parts:  Error code  Error message  Severity level CPD0740 10 PGM command missing.

References 800 ' does not exist. * E N D O F C R O S S GRA 5763SS1 V6R1M0 090517 Declared Variables Name Defined &JOB 100 &USR 200 * CPD0726 10 Variable '&USR Defined Labels Label Defined END ****** * CPD0715 30 Label 'END * * * * Copyright 2009 by Janson Industries R E F E R E N C E 37 . the statement numbers that reference each are displayed Errors messages listed here also Control Language Cross Reference Type Length References *CHAR 7 300 500 *CHAR 10 ' d eclared but not referred to.Cross Reference table   For every variable and label.

Error Message Summary     Error message total Subtotals by severity level Successful or not message Max severity Message Summary Severity Total 0-9 10-19 20-29 30-39 40-49 50-59 60-69 70-79 80-89 90 8 0 3 0 2 3 0 0 0 0 Program COMPILEEX not created in library GRADES. * * * ** E N D O F M E SS A G E S U M Severity 20 errors (and higher) stop the compile 38 Copyright 2009 by Janson Industries . Maximum error severity 40.

the system generates at least one message  Often many messages 39 Copyright 2009 by Janson Industries .Run Time Errors  Source code that compiles can still have fail when run Why?  Non-syntax  User  errors Endless loop input errors  Missing resources A required library or file does not exist  If there is a run time error.

all messages are written to the JOBLOG How to see the JOBLOG depends on the interface being used   40 Copyright 2009 by Janson Industries .JOBLOG  What message(s) are displayed and where depends on the interface However.

Work with members 9. + 41 Copyright 2009 by Janson Industries . Work with objects 3.5250 Run Time Errors  The system generated message will be displayed at the bottom of the screen Programming Development Manager (PDM) Select one of the following: 1. Work with user-defined options + means there's more to the message Selection or command ===> call library99/testpgm parm("library98")___________________________________ _______________________________________________________________________________ F3=Exit F4=Prompt F9=Retrieve F10=Command entry F12=Cancel F18=Change defaults Parameters passed on CALL do not match those required. Work with libraries 2.

Work with libraries 2. Work with user-defined options Selection or command ===> call library99/testpgm parm("library98")___________________________________ _______________________________________________________________________________ F3=Exit F4=Prompt F9=Retrieve F10=Command entry F12=Cancel F18=Change defaults Error found on CALL command.5250 Run Time Errors  Click on message and press Page Down to display more of the message text Programming Development Manager (PDM) Select one of the following: 1. Work with members 9. 42 Copyright 2009 by Janson Industries . Work with objects 3.

5250 Run Time Errors  For more info about the problem:  Move the cursor to the message  Press F1  Additional Message Information will be displayed for the message  Additional Message Information will display  The original message  Reasons for the error  Step to correct the error 43 Copyright 2009 by Janson Industries .

Recovery . . . . : Date sent . . Cause . Change the CALL command and then try the command again. F1=Help F3=Exit F6=Print F10=Display messages in job log Copyright 2009 by Janson Industries F9=Display message details F12=Cancel F21=Select assistance level 44 . . The number of parameters or the type of parameters passed on the CALL command must match those expected by the program called. . : The parameters passed on the CALL command do not match the parameters required by program TESTPGM in library LIBRARY99. : If correct program not found. . . . Bottom Press Enter to continue. : 10:41:52 Parameters passed on CALL do not match those required. : Message . . Correct program not found or correct parameters not passed. : CPD0172 05/15/09 Time sent . . . . . change or specify the library name on the command or in a library list. . . . . . .5250 Run Time Errors Additional Message Information Message ID . . . . .

 Not  just the one displayed by the system  Display the JOBLOG by  Pressing F10 at the Additional Message Information screen  Or issue the DSPJOBLOG command then F10 and Page Up 45 Copyright 2009 by Janson Industries .JOBLOG  Most of the time. all messages need to be checked. Additional Message Information will be enough to understand the problem If not.

Error found on CALL command. Error found on CALL command. Bottom Press Enter to continue. . : USFL1AD001 System: Number . . : QPADEV0004 User . . .JOBLOG Display All Messages Job . F3=Exit F5=Refresh F12=Cancel F17=Top F18=Bottom 46 Copyright 2009 by Janson Industries . : 098011 4>> call library99/testpgm parm("library98") Parameters passed on CALL do not match those required. Parameters passed on CALL do not match those required.

RDi Run Time Errors  The Commands log will display:  The original command  All the JOBLOG messages  Additional message info for the messages 47 Copyright 2009 by Janson Industries .

some run time errors are not the result of incorrect programming:  Incorrect user input  Lack of authority  No data  The program should not end when these types of errors occur The program should check for these conditions and provide user friendly messages 48  Copyright 2009 by Janson Industries .Run Time Errors  As mentioned.

NOT the OS.allows the program.Monitoring for Messages  MONMSG . to handle specified message(s) The CL command in the EXEC keyword is executed when the error occurs If MONMSG placed right after DCL¶s:  EXEC   performed regardless of the program statement causing the error  If MONMSG follows a command:  EXEC performed only if the preceding command caused the specified error 49 Copyright 2009 by Janson Industries .

Monitoring for Messages 

CPF9810 - library does not exist CPF9812 - file does not exist The above MONMSG invokes an error handling subroutine called NOFILE
MONMSG MSGID(CPF9812)

MONMSG MSGID(CPF9810) EXEC(CRTLIB &LIBNAME) 

MONMSG MSGID(CPF9812) EXEC(CALLSUBR SUBR(NOFILE))  

No EXEC keyword means the error will be ignored
50

Copyright 2009 by Janson Industries

Defining a Subroutine 

SUBR/ENDSUBR commands surround the subroutine code SUBR keyword in SUBR commands assigns a name
PGM PARM(&LIBNAME &FILENAME &MEMNAME &MEMTYPE) CALLSUBR SUBR(NOFILE) 

000100 START: 000200 000300 000400 : : 020500 020600 020700 020800 020900

SUBR

SUBR(NOFILE) /* Subroutine executable statements */ /* Subroutine executable statements */ ENDSUBR
51

Copyright 2009 by Janson Industries

Defining a Subroutine 

Subroutines defined at end of code Will only be executed when called 
Not 

executed as sequential statements 

After the subroutine executes, control returns to next sequential statement after the CALLSUBR command (line 400)
PGM PARM(&LIBNAME &FILENAME &MEMNAME &MEMTYPE) CALLSUBR SUBR(NOFILE)

000100 START: 000200 000300 000400 : : 020500 020600 020700 020800 020900

SUBR

SUBR(NOFILE) /* Subroutine executable statements */ /* Subroutine executable statements */ ENDSUBR
52

Copyright 2009 by Janson Industries

Error Handling Routines  Can further investigate the cause of the problem Perform complex functions to solve the problem Allow the user to select a course of action from program defined options   53 Copyright 2009 by Janson Industries .

Message Replies  Messages can be sent that require a reply The reply can be stored in a program variable The reply value can be the basis for conditional statement execution   54 Copyright 2009 by Janson Industries .

') + MSGRPY(&REPLY) VALUES(Y N)) IF COND(&REPLY *EQ N) THEN(GOTO END) IF COND(&REPLY *EQ Y) THEN(CRTLIB &LIBNAME) 55 Copyright 2009 by Janson Industries . the statement(s) following THEN will be performed   MONMSG MSGID(CPF9810) EXEC(SNDUSRMSG MSG('THE LIBRARY + SPECIFIED DOES NOT EXIST. TO END THE PROGRAM.Message Replies  MSGRPY . REPLY WITH A "N".if true.Identifies the program variable to hold the reply VALUES .Defines the valid values that can be entered as a reply IF condition . TO CREATE THE LIBRARY. REPLY + WITH A "Y".

So. a program and prompt screen must be created before creating a command CL command objects have type = *CMD A prompt screen makes it easier for a user to supply data to a program 56    Copyright 2009 by Janson Industries .Creating CL Commands  Creating a CL command entails identifying a program and prompt screen to be called when the command is issued.

Creating a CL Command Library Programmer specifies: Name of new command Prompt screen member Program to run for command PGMTORUN *PGM CLP CRTCMD NEWCMD PRMPTSCR PGMTORUN Programmer 57 Copyright 2009 by Janson Industries PF-SRC NEWCMD *CMD PRMPTSCR CMD RDi SEU CL commands .

PAPPY!') 58 Copyright 2009 by Janson Industries .Prompt Screen  The prompt screen for the following program must have 4 data entry fields PGM PARM(&LIBNAME &FILENAME &MEMNAME &MEMTYPE) DCL DCL DCL DCL VAR(&FILENAME) VAR(&MEMNAME) VAR(&LIBNAME) VAR(&MEMTYPE) TYPE(*CHAR) TYPE(*CHAR) TYPE(*CHAR) TYPE(*CHAR) LEN(10) LEN(10) LEN(10) LEN(3) + + 000100 START: 000200 000300 000400 000500 000600 000700 000800 CRTMBR: 000900 001000 001100 001100 001300 001400 END: STRSEU SRCFILE(&LIBNAME/&FILENAME) SRCMBR(&MEMNAME) TYPE(&MEMTYPE) SNDUSRMSG ENDPGM MSG('IT''S DONE.

. . . .Prompt Screen Example CREATE MEMBER (CRTMBR) Type choices. . . . . . press Enter. . . . . . . . . . . . SOURCE FILE . . . . . . YOURLIB ___________ ___________ ___ NAME NAME NAME CLP RPG PF CBL LF F3=Exit F4=Prompt F5=Refresh F12=Cancel Bottom F13=How to use this display F24=More keys 59 Copyright 2009 by Janson Industries . . . . . SOURCE MEMBER MEMBER TYPE . . . . . . . . LIBRARY . . .

Prompt Screens  Special CL commands to define prompt screens CMD .only required command. The keyword PROMPT defines the screen title PARM .used to define an entry   60 Copyright 2009 by Janson Industries .

defines the fields keyword .length of field  CHOICE . describes the field .text that will appear to the left of the field.PARM command  PARM keywords used to define a field:  KWD .text that will appear to the right of the field regarding value choices .defines a default value for the field 61  PROMPT  DFT  VALUES/RSTD Copyright 2009 by Janson Industries .identifies the only valid values for the field .type of data the field will accept  TYPE  LEN .

Prompt Screen Source Example CMD PARM PROMPT('CREATE MEMBER') KWD(LIB) TYPE(*CHAR) LEN(11) + CHOICE('NAME') + PROMPT('LIBRARY') DFT(YOURLIB) KWD(FILE) TYPE(*CHAR) LEN(11) + CHOICE('NAME') + PROMPT('SOURCE FILE') KWD(MBR) TYPE(*CHAR) LEN(11) + CHOICE('NAME') + PROMPT('SOURCE MEMBER') KWD(TYPE) TYPE(*CHAR) LEN(3) + CHOICE('CLP RPG PF CBL LF') + PROMPT('MEMBER TYPE') PARM PARM PARM 62 Copyright 2009 by Janson Industries .

. . .Prompt Screen Example CMD PROMPT('CREATE MEMBER') CREATE MEMBER (CRTMBR) Type choices. . . press Enter. . . . LIBRARY . SOURCE MEMBER MEMBER TYPE . . . . . . . . . . . . . . . . . . . . . . . SOURCE FILE . . . . . . . YOURLIB ___________ ___________ ___ NAME NAME NAME CLP RPG PF CBL LF PARM KWD(TYPE) TYPE(*CHAR) LEN(3) + CHOICE('CLP RPG PF CBL LF') + PROMPT('MEMBER TYPE') 63 Copyright 2009 by Janson Industries . . .

Name Name. . . . Name. . . Source file . . press Enter. . . . . . Name. . . . . . . . . . . .Creating the command . . . . . . Program to process Library . . . . . . . . . . Library . . . . . . . . Source member . . command . . . . . . . . . . . Text 'description' . *CURLIB *LIBL. . Name. Command . *CURLIB *REXX *LIBL.CRTCMD Create Command (CRTCMD) Type choices. Library . . . > CRTMBR > YOURLIBXX > CRTMBR > YOURLIBXX QCMDSRC > YOURLIBXX CRTMBR *SRCMBRTXT Name Name. . *CURLIB *CMD Command to be created Program that will be called Prompt screen to display (source definition) 64 Copyright 2009 by Janson Industries . . . . . . . . .

Points to Remember  CL commands can be ³grouped´ into programs Compilation reports are used to diagnose compile errors The JOBLOG helps diagnose run time errors Users can create their own CL commands and prompt screens 65    Copyright 2009 by Janson Industries .

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->