The mainframe and it’s scripting language is a weird beast. Here’s a sample of the scripting language
//LZIOTEST JOB
//A EXEC PGM=IOTEST
//SYSOUT DD SYSOUT=*
//*SYSPRINT DD SYSOUT=*
//SYSPRINT DD DSN=PJOOT.OUT6,DISP=(MOD,KEEP,KEEP),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=800)
When I see this, my gut feeling is to ignore it all, since it looks like a comment. The comments are actually the //* lines, so that is equivalent to:
//LZIOTEST JOB
//A EXEC PGM=IOTEST
//SYSOUT DD SYSOUT=*
//SYSPRINT DD DSN=PJOOT.OUT6,DISP=(MOD,KEEP,KEEP),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=800)
If I understand things properly, the commands in this particular JCL are:
- JOB (with parameter value LZIOTEST, that identifies the job output in the spool reader)
- EXEC (with parameter A, which I believe is a step name), and a specification of what to execute for that step (my IOTEST code in this case).
- DD (define an alias for a file (called a DATASET in mainframe-ese)
The SYSPRINT line associates a DDNAME “SYSPRINT” with a file (i.e. a DATASET) named PJOOT.OUT6. Creating a file seems very painful to do, requiring specification of blocksize, filetype (DSORG), record length, record format (Fixed Blocked in this case), and a DISPosition (whether to create/modify/access-shared/…, and what action to take if the JCL script succeeds or fails). Once that file is created it can then accessed by DDNAME in fopen (i.e. fopen( “DD:SYSPRINT”, …). I have the feeling that REXX, COBOL, AND PL/1 operate on the DDNAME exclusively, and don’t require it to be prefixed with DD: as the Z/OS C/C++ runtime docs for fopen suggest.
Another oddity with JCL is that it appears to have an 80 character line limitation. For example, the following produces JCL syntax errors.
//SYSPRINT DD DSN=PJOOT.OUT6,DISP=(MOD,KEEP,KEEP),DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=800)
A trailing comma appears to be the required continuation character. I don’t know if the indenting I used for DCB= matters, but suspect not.
Hi Peeter,
Man you take me back. JCL is brilliant, took me years to get over the anarchy of the lower species. You’ll come to like it. DD is data definition, and the name (//NAME DD … ) is a reference within the program (EXEC) used for I/O. This allows the JCL to bind the name to whatever dataset you want at runtime. On all other systems, this setup is arbitrary , essentially whatever the developer dreamed up; so every utility/app of whatever size brings it’s own paradigm to configuration.
Hope you are doing well!