Creating a data set member for JCL
Coding JCL (using a predefined sample)
Submitting the job
Viewing the job output
What inputs (resources) you will need and where they are located
What program you plan to use.
Where the output, if any, should go. (When the job completes, you will either dispose of the output or hold it for later printing or for viewing).
For this example, we are going to see sorting a simple file and list the contents alphabetically.
Edit the JCL data set that you just allocated userid.SORT.JCL and add the below JCL. Use ISPF (or equivalent function) to edit the data set.
//SORT001 JOB '417','SRINI',NOTIFY=XSR12345,MSGCLASS=S, // MSGLEVEL=(1,1),CLASS=C ---> JOB statement with parameters //* //STEP1 EXEC PGM=SORT ---> EXEC statements to execute SORT utility //SYSIN DD * ---> DD statement with DD name SYSIN, specifies how you want the sort to be done SORT FIELDS=(1,10,CH,A) /* //SYSOUT DD SYSOUT=* ---> DD statement with DD name SYSOUT, specifies the data set to which SORT will write its messages. //SORTIN DD * ---> DD statement with DD name SORTIN, specifies input records or file. JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER /* //SORTOUT DD SYSOUT=* ---> DD statement with DD name SORTOUT, specifies output record will be return. /* |
Note: '--->' symbol is not part of JCL coding. we just added a description for each line for your reference. Please omit the text after the "--->"(including) in your JCL.
When you have finished entering the JCL into the data set, submit the job by entering the SUBMIT command from the ISPF EDIT command line, the TSO/E command line, or following a READY mode message.
When the job ends, you will receive a message indicating one of three conditions: job successful, JCL error, or program abend.
If the message indicates the error or abend condition, you have to find the error reason and correct the error. then submit the job again(i.e. review steps 2 and 3 of this exercise to make sure that you followed the instructions exactly, then resubmit the job.).
Use your installation's viewing facility (for example, SDSF) to view the output and determine whether the job completed successfully.
Running your job will produce three types of held output:
1. System messages from JES and z/OS 2. Your JCL code with procedures expanded, overrides applied, and symbolics resolved. 2. Output as requested by the JCL code. |
Held output may be viewed, printed, or purged. You can get below listed deails from the SDSF.
1. Installation-specific detals and it may differ on each system. 2. Amount of execution time of the job. 3. It contains the JCL statements or JCL listing, that resulted from the job. 4. The system output messages resulting from processing the job. 5. The condition code 0000 tells you that the program ran successfully. You receive one condition code for each step in the job. If a condition code is non-zero, that means job run failed. 6. Also, you can see output produced by the program. |
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!