Setting PATH in IEBGENER from file

635 views Asked by At

I'm trying to set the PATH parameter in a IEBGENER step in a JCL from a file. But I can't seem to get it to work.

Here is what the original step, that works just fine, looks like:

//COPY   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT1   DD *
 Some text
//SYSUT2   DD PATH='/local/Folder1/File1',
//            PATHDISP=(KEEP,KEEP),
//            PATHOPTS=(OWRONLY,OCREAT,OEXCL),
//            PATHMODE=(SIRUSR,SIWUSR)

What I want to do is set the PATH parameter in SYSUT2 from a file that is written in some previous step. Something like this:

BROWSE    TEST.FILE1                                Line 0000000000 Col 001 080
Command ===>                                                  Scroll ===> CSR
    ********************************* Top of Data **********************************
TPATH='/local/Folder1/File1'
******************************** Bottom of Data ********************************



//SETPATH SET DSN=TEST.FILE1,DISP=SHR
//*
//COPY   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT1   DD *
 Some text
//SYSUT2   DD PATH='&TPATH',
//            PATHDISP=(KEEP,KEEP),
//            PATHOPTS=(OWRONLY,OCREAT,OEXCL),
//            PATHMODE=(SIRUSR,SIWUSR)

This of course complains about no variable TPATH in the JCL, which logically makes sense as it can't find the variable name in the JCL. Also tried putting the entire SYSUT2 in a separate file, but without success.

A "good enough" compromise would be to concatenate a file prefix with a date and time parameter, but that would only work in production when the job is run via a scheduler (with OPCSCAN or similar). Not in test where I submit the job myself, or is it possible to do that without a scheduler?

'/local/Folder1/File' & iDate & iTime   -- You get the point.

Any ideas much appreciated!

1

There are 1 answers

0
cschneid On

One way to do this would be to write the SYSUT2 DD statement to a member in a separate PDS or PDSE, then INCLUDE that member in your IEBGENER step. The separate PDS or PDSE must be specified in a JCLLIB statement.

You could also run BPXBATCH and use cp instead of IEBGENER to copy your data.

If you have the Dovetail Technologies Co:Z Toolkit installed, fromdsn might be what you're looking for.