Page 3 of 3

Re: DD Statements and Missing Modules

PostPosted: Sun Sep 23, 2012 10:46 am
by steve-myers
We're not here to write tutorials, but here goes.

Let's say you have a program like this.
WRITER   CSECT
         ...
         OPEN  (OUTDCB,OUTPUT)
         ...
         CLOSE OUTDCB
         ...
OUTDCB   DCB   DSORG=PS,MACRF=PM,DDNAME=OUTPUT
         END
Now, obviously this is not a complete program. It writes data to one dataset, specified by a DD statement with DD name OUTPUT.

Your installation defines a cataloged procedure to assemble, link edit, and execute an Assembler program called XCLG. It has these statements.
//XCLG    PROC
//C       EXEC PGM=ASMA90,PARM='OBJECT,NODECK'
//SYSPRINT DD  SYSOUT=*
          ...
//SYSLIN   DD  DISP=(MOD,PASS),UNIT=SYSDA,SPACE=(CYL,(1,1)),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=296),
//             DSN=&&LOADSET
          ...
//L       EXEC PGM=IEWL,PARM='MAP,LIST'
//SYSPRINT DD  SYSOUT=*
//SYSLIN   DD  DISP=(OLD,PASS),DSN=&&LOADSET
//SYSLMOD  DD  DISP=(NEW,PASS),UNIT=SYSDA,SPACE=(CYL,(1,1,1)),
//             DSN=&&GOSET(GO)
//G       EXEC PGM=*.L.SYSLMOD

This procedure has three steps. The first step, identified by step name C, assembles the source program. One of the datasets , identified by DD name SYSLIN, contains the binary program created by the Assembler from your source. This data is not executable as it exists. This dataset has temporary dataset name &&LOADSET

The second step, identified by step name L, prepares a binary executable load module from the object output from the Assembler. The load module is stored in a temporary dataset identifed by data set name &&GOSET and member name GO.

The third step, identified by step name G, executes the load module prepared by the L step. This step has no DD statements. Well, actually that's not quite true. The trick EXEC statement defines a DD statement that is the temporary dataset created by the SYSLMOD DD statement in the L step. It was done this way because the early OS/360 did not have STEPLIB DD statements, and this trick was used to get around this lack.

To run your program you would use JCL like this:
//USERJCL  JOB ...
//A       EXEC XCLG
//C.SYSIN  DD  -- Dataset containing source program --
//G.OUTPUT DD  -- Output dataset --
The first DD statement after the // EXEC statement is //C.SYSIN. The C. in the DD name tells the system this DD statement belongs the step C. The next DD statement specifies //G.OUTPUT. The G. in the DD name tells the system the DD statement belongs tpo step G, but the actual DD name is OUTPUT, not G.OUTPUT.

Re: DD Statements and Missing Modules

PostPosted: Sun Sep 23, 2012 11:27 am
by RISCCISCInstSet
Okay, I got something that seems to work, with this sub-problem. I'll get back to this thread if I find it's not really solved and I can't straighten it out without a little help. Thanks! :)

Re: DD Statements and Missing Modules

PostPosted: Sun Sep 23, 2012 11:31 am
by RISCCISCInstSet
(another thing - I meant seriousness not hostility with the previous textual emoticon)