{"id":235,"date":"2012-08-15T20:53:03","date_gmt":"2012-08-15T20:53:03","guid":{"rendered":"http:\/\/62.131.51.129\/wordpress\/?p=235"},"modified":"2012-08-15T20:53:03","modified_gmt":"2012-08-15T20:53:03","slug":"jcl-or-the-stern-face-of-a-main-frame","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=235","title":{"rendered":"JCL or the stern face of a main frame"},"content":{"rendered":"<p>I realise that working on a main frame can be very intimidating. Look at the JCL: the job language that you use to get things done. This is the way how you might copy files, how to execute a programme, to compile a programme. This implies that you will use the JCL every day when working on a main frame.<\/p>\n<p>Let us see how such JCL looks like:<\/p>\n<p><a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2012\/08\/jclscreen.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-223\" title=\"jcl\" src=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2012\/08\/jclscreen.jpg\" alt=\"\" width=\"580\" height=\"594\" \/><\/a><\/p>\n<p>This is a programme that writes two lines &#8220;0 tom&#8221; and &#8220;1 papa&#8221; to a file (or data set as it is called on a mainframe). Oops: to get it done, one needs 9 lines of jcl.<br \/>\nOn the other hand, most of the lines can be reused. Take as an example, the first two lines that give a name to the job. These lines are probably only created once and later copied from job to job.<br \/>\nI can also imagine that this programme that copies two lines into a file, is used as a skeleton to copy lines into files. Only a change in the lines or the filename is sufficient to perform a new task.<\/p>\n<p>On book helped me hugely to understand jcl: Murach&#8217;s OS\/390 and z\/OS JCL. This helped me to pass that impressive hurdle.<\/p>\n<p>But let us go back to the JCL.<br \/>\n[1] The first two lines indicate the jobname. These two lines can be copied from job to job. They indicate what job is run and who is accounted for the costs of the job.<br \/>\n[2] The third line indicates what is done. In this case the programme IEBGENER. This programme copies one dataset to another. The programme IEBGENER requires four datasets. These four datasets are described in subsequent lines.<br \/>\n[3] SYSIN: it must be included but the reason is not really clear in a copy statement<br \/>\n[4] SYSPRINT: indicates where the job warnings are written<br \/>\n[5] SYSUT2: the output dataset. As a new dataset is created, the properties must be indicated<br \/>\n[6] SYSUT1: the input dataset. In this case the input dataset is directly included as an instream dataset.<\/p>\n<p>One could make minor modifications. Such a modification is given below. In this case the output dataset is an existing dataset and the data are appended to the bottom of the dataset.<\/p>\n<p>This implies that only the SYSUT2 statement must be changed. The programme below copies the data to the bottom of the output dataset.<\/p>\n<pre>000001 \/\/MAAN093 JOB (12345678),MAAN093,MSGCLASS=H,\n000002 \/\/ MSGLEVEL=(1,1),CLASS=A,NOTIFY=&amp;SYSUID\n000003 \/\/STEP1 EXEC PGM=IEBGENER\n000004 \/\/SYSIN DD DUMMY\n000005 \/\/SYSPRINT DD SYSOUT=* KOMMENTAAR VAN NIKS\n000006 \/\/SYSUT2 DD DISP=(MOD,KEEP),DSN=MAAN093.DATA.TXT16\n000007 \/\/SYSUT1 DD *\n000008 01 TOM\n000009 03 INE1\n000010 \/*<\/pre>\n<p>Let us go to another programme. Just to show what is possible in JCL. The programme looks like:<\/p>\n<pre>000001 \/\/MAAN093 JOB 'MAAN093',CLASS=A,MSGCLASS=X,NOTIFY=&amp;SYSUID\n000002 \/\/*------------------------------------------*\n000003 \/\/GOOI PROC\n000004 \/\/MAKEFI EXEC PGM=IEFBR14\n000005 \/\/DD2 DD DSN=MAAN093.FLIP.TXT,DISP=(SHR,DELETE) GOOIT OUD WEG\n000006 \/\/ PEND\n000007 \/\/*------------------------------------------*\n000008 \/\/STEP EXEC GOOI<\/pre>\n<p>This programme creates a procedure that is called &#8220;gooi&#8221;. This procedure starts with a declaration: &#8220;gooi proc&#8221; and it ends with &#8220;pend&#8221; to state where the procedure ends. This procedure &#8220;gooi&#8221; contains two lines. One line indicates what is to be done. In this case IEFBR14 is executed: the deletion of a file. The file that is deleted is indicated by the dd2 line.<br \/>\nThe procedure &#8220;gooi&#8221; is executed in the last line: exec gooi will initiate the gooi procedure.<\/p>\n<p>&nbsp;<br \/>\nTo finalise, some more examples of JCL code<br \/>\n<a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2012\/08\/sortJCL.pdf\">Sortprocedure with JCL<\/a><br \/>\n&nbsp;<br \/>\n<a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2012\/08\/sorttwee.pdf\">Combine two input datasets into one sortprocedure with JCL<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I realise that working on a main frame can be very intimidating. Look at the JCL: the job language that you use to get things done. This is the way how you might copy files, how to execute a programme, to compile a programme. This implies that you will use the JCL every day when [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-235","post","type-post","status-publish","format-standard","hentry","category-nice-to-know"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=235"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/235\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}