Home › Mainframe Tutorial › All commands
All commands
Every command of this course: name, detailed description, syntax and example code.
Every command used in this course, with its name, a detailed description, the syntax and an example.
JOB
Definition: The first statement of a job. It gives the job a name and says who runs it and how its messages are handled.
Syntax:
//NAME JOB (account),'comment',CLASS=A,MSGCLASS=X
Example:
//HELLO JOB (ACCT),'HELLO',CLASS=A,MSGCLASS=X
EXEC
Definition: Starts a step by running a program (PGM=) or a cataloged procedure.
Syntax:
//STEP1 EXEC PGM=program
Example:
//STEP1 EXEC PGM=IEBGENER
DD
Definition: Data Definition: connects a dataset, in-stream data or printed output to a step.
Syntax:
//DDNAME DD parameters
Example:
//SYSPRINT DD SYSOUT=*
DSN
Definition: The DD parameter that names the dataset to use.
Syntax:
DSN=dataset.name
Example:
//OUT DD DSN=USER1.TEST.DATA,DISP=SHR
DISP
Definition: Tells the system the dataset status and what to do with it when the step ends.
Syntax:
DISP=(status,normal,abnormal)
Example:
DISP=(NEW,CATLG,DELETE)
SYSOUT
Definition: Sends output to the job's printed output so you can read it.
Syntax:
//DDNAME DD SYSOUT=class
Example:
//SYSUT2 DD SYSOUT=*
IEFBR14
Definition: A program that does nothing. It is used for its DD statements to create or delete datasets.
Syntax:
//STEP1 EXEC PGM=IEFBR14
Example:
//STEP1 EXEC PGM=IEFBR14 //NEWDS DD DSN=USER1.NEW,DISP=(NEW,CATLG)
SUBMIT
Definition: In ISPF you edit datasets, browse job output and run SUBMIT to send a job to the system.
Syntax:
SUBMIT
Example:
SAY "Use SUBMIT to run a job"
USER1.TEST.DATA
Definition: Names have parts separated by dots, such as USER1.TEST.DATA .
Syntax:
USER1.TEST.DATA
Example:
//NEWDS DD DSN=USER1.TEST.DATA,DISP=(NEW,CATLG,DELETE),
SORT
Definition: The SORT program sorts records.
Syntax:
SORT
Example:
//SORTJOB JOB (ACCT),'SORT',CLASS=A,MSGCLASS=X //STEP1 EXEC PGM=SORT SORT FIELDS=(1,6,CH,A)
SORTIN
Definition: SORTIN is the input, SORTOUT is the output and the control statement in SYSIN says how: SORT FIELDS=(1,6,CH,A) sorts 6 characters from column 1 in ascending order.
Syntax:
SORTIN
Example:
//SORTIN DD *
SORTOUT
Definition: SORTIN is the input, SORTOUT is the output and the control statement in SYSIN says how: SORT FIELDS=(1,6,CH,A) sorts 6 characters from column 1 in ascending order.
Syntax:
SORTOUT
Example:
//SORTOUT DD SYSOUT=*
SYSIN
Definition: SORTIN is the input, SORTOUT is the output and the control statement in SYSIN says how: SORT FIELDS=(1,6,CH,A) sorts 6 characters from column 1 in ascending order.
Syntax:
SYSIN
Example:
//SYSIN DD *
IDCAMS
Definition: The IDCAMS utility defines, copies, prints and deletes them.
Syntax:
IDCAMS
Example:
//VSAMJOB JOB (ACCT),'IDCAMS',CLASS=A,MSGCLASS=X //STEP1 EXEC PGM=IDCAMS
IGYWCLG
Definition: The cataloged procedure IGYWCLG compiles, links and runs a program.
Syntax:
IGYWCLG
Example:
//STEP1 EXEC IGYWCLG
COBOL.SYSIN
Definition: The source goes in COBOL.SYSIN and the output of DISPLAY goes to GO.SYSOUT .
Syntax:
COBOL.SYSIN
Example:
//COBOL.SYSIN DD *
DISPLAY
Definition: The source goes in COBOL.SYSIN and the output of DISPLAY goes to GO.SYSOUT .
Syntax:
DISPLAY
Example:
DISPLAY "HELLO FROM COBOL ON Z/OS".
GO.SYSOUT
Definition: The source goes in COBOL.SYSIN and the output of DISPLAY goes to GO.SYSOUT .
Syntax:
GO.SYSOUT
Example:
//GO.SYSOUT DD SYSOUT=*
SELECT
Definition: Batch programs and online programs can run SELECT , INSERT , UPDATE and DELETE .
Syntax:
SELECT
Example:
SELECT NAME, DEPT
SAY
Definition: SAY prints a value, and DO repeats a block.
Syntax:
SAY
Example:
SAY "Line" i
DO
Definition: SAY prints a value, and DO repeats a block.
Syntax:
DO
Example:
DO i = 1 TO 3
COND
Definition: The COND parameter decides whether a later step runs.
Syntax:
COND
Example:
//STEP2 EXEC PGM=IEFBR14,COND=(0,NE)
S0C7
Definition: The codes tell you the reason: S0C7 is bad numeric data, S806 means the program was not found, B37 means a dataset ran out of space and S222 means the job was cancelled.
Syntax:
S0C7
Example:
SAY "S0C7 - bad numeric data"
S806
Definition: The codes tell you the reason: S0C7 is bad numeric data, S806 means the program was not found, B37 means a dataset ran out of space and S222 means the job was cancelled.
Syntax:
S806
Example:
SAY "S806 - program not found"
B37
Definition: The codes tell you the reason: S0C7 is bad numeric data, S806 means the program was not found, B37 means a dataset ran out of space and S222 means the job was cancelled.
Syntax:
B37
Example:
SAY "B37 - out of space on a disk dataset"
S222
Definition: The codes tell you the reason: S0C7 is bad numeric data, S806 means the program was not found, B37 means a dataset ran out of space and S222 means the job was cancelled.
Syntax:
S222
Example:
SAY "S222 - job cancelled"
Example code
//HELLO JOB (ACCT),'HELLO',CLASS=A,MSGCLASS=X
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT2 DD SYSOUT=*
//SYSUT1 DD *
HELLO FROM THE MAINFRAME
/*