View previous topic :: View next topic
Author
Message
reach2abhinavtyagi New User Joined: 04 Aug 2016Posts: 7 Location: India
Hi,
I have a requirement to read 10 input Mainframe files in a PROC and do the following - Capture input DSN names into the Output files. These input files can be VSAM, GDG or Flat file. Input Dataset names names are not fixed, they may be over ridden through Job.
I have a solution using ICETOOL with JPn parameter in PARM but it works only for 2 files (as PARM has max length of 100 and it could accomodate only 2 files). So have to repeat the step 5 times to process 10 files and later merge the output from each step. However, I want to do this within SINGLE Step if possible.
Also, I tried using IDCAMS + LISTCAT to extract names from fixed positions in SYSPRINT. But LISTCAT does not allow me to pass DDNAME asinput, it asks for Exact Mainframe DSN names to be HARDCODED, which is not suitable for my requirement.
Please suggest. Thanks
Regards
Abhinav
Back to top
Rohit Umarjikar Global Moderator Joined: 21 Sep 2010Posts: 3077 Location: NYC,USA
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2154 Location: USA
reach2abhinavtyagi wrote:
Hi,
I have a requirement to read 10 input Mainframe files in a PROC and do the following - Capture input DSN names into the Output files. These input files can be VSAM, GDG or Flat file. Input Dataset names names are not fixed, they may be over ridden through Job.
I have a solution using ICETOOL with JPn parameter in PARM but it works only for 2 files (as PARM has max length of 100 and it could accomodate only 2 files). So have to repeat the step 5 times to process 10 files and later merge the output from each step. However, I want to do this within SINGLE Step if possible.
Also, I tried using IDCAMS + LISTCAT to extract names from fixed positions in SYSPRINT. But LISTCAT does not allow me to pass DDNAME asinput, it asks for Exact Mainframe DSN names to be HARDCODED, which is not suitable for my requirement.
Please suggest. Thanks
Regards
Abhinav
Don't use ICETOOL, use regular SORT instead.
This would make you happy.
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2154 Location: USA
Code:
//*=====================================================================
//SORTDSNS PROC DS=NULLFILE
//*
//*=====================================================================
//* PROCESS DATASET NAMES
//*=====================================================================
//CONTENT EXEC PGM=SORT,
// PARM='JP0"&DS"'
//*
//SYSOUT DD SYSOUT=*
//*
//SORTIN DD DISP=SHR,DSN=&DS
//*
//DATAOUT DD DISP=(MOD,PASS),
// UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE),
// DSN=&&DATAOUT
//*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FTOV,FNAMES=DATAOUT,
HEADER1=(C'*** START OF DATA FROM DSN=',JP0),
TRAILER1=(C'*** END OF DATA FROM DSN=',JP0)
END
//*
// PEND
//*
//*=====================================================================
//DSN#1 EXEC SORTDSNS,DS=&SYSUID..DSN#1
//DSN#2 EXEC SORTDSNS,DS=&SYSUID..DSN#2
//DSN#3 EXEC SORTDSNS,DS=&SYSUID..DSN#3
//DSN#4 EXEC SORTDSNS,DS=&SYSUID..DSN#4
//DSN#5 EXEC SORTDSNS,DS=&SYSUID..DSN#5
//DSN#6 EXEC SORTDSNS,DS=&SYSUID..DSN#6
//DSN#7 EXEC SORTDSNS,DS=&SYSUID..DSN#7
//DSN#8 EXEC SORTDSNS,DS=&SYSUID..DSN#8
//DSN#9 EXEC SORTDSNS,DS=&SYSUID..DSN#9
//DSN#10 EXEC SORTDSNS,DS=&SYSUID..DSN#10
//*
//*=====================================================================
//PRINT EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
//SYSUT1 DD DISP=(OLD,DELETE),DSN=&&DATAOUT
//SYSUT2 DD SYSOUT=*
//*=====================================================================
Code:
*** START OF DATA FROM DSN=SUPERUSR.DSN#1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#1
*** START OF DATA FROM DSN=SUPERUSR.DSN#2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#2
*** START OF DATA FROM DSN=SUPERUSR.DSN#3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#3
*** START OF DATA FROM DSN=SUPERUSR.DSN#4
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#4
*** START OF DATA FROM DSN=SUPERUSR.DSN#5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#5
*** START OF DATA FROM DSN=SUPERUSR.DSN#6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#6
*** START OF DATA FROM DSN=SUPERUSR.DSN#7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#7
*** START OF DATA FROM DSN=SUPERUSR.DSN#8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#8
*** START OF DATA FROM DSN=SUPERUSR.DSN#9
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#9
*** START OF DATA FROM DSN=SUPERUSR.DSN#10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*** END OF DATA FROM DSN=SUPERUSR.DSN#10
Back to top
reach2abhinavtyagi New User Joined: 04 Aug 2016Posts: 7 Location: India
Thanks..
The above solution has already been tried and working. But this one has mutiple steps to process 10 files.
Is it possible to reduce the number of steps to Max 3.
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2154 Location: USA
reach2abhinavtyagi wrote:
Thanks..
The above solution has already been tried and working. But this one has mutiple steps to process 10 files.
Is it possible to reduce the number of steps to Max 3.
Write REXX script to read DSN list from whatever source, and call PGM=SORT from REXX as many times as needed, within the same job step.
Back to top
Rohit Umarjikar Global Moderator Joined: 21 Sep 2010Posts: 3077 Location: NYC,USA
Quote:
Is it possible to reduce the number of steps to Max 3.
Why would JOINKEY's won't here?
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2154 Location: USA
reach2abhinavtyagi wrote:
Thanks..
The above solution has already been tried and working. But this one has mutiple steps to process 10 files.
Is it possible to reduce the number of steps to Max 3.
Check with your zOS team if your JES version does support the JCL option EXPORT/SYMBOLS?
If yes, then you can pass JCL/PROC parameters straightforward into your input stream data (e.g. SORT control statements) - as many as needed.
This would be the simplest solution.
You can just try your test to check this
Code:
//TESTJOB JOB …
// EXPORT SYMLIST=(*)
//DUMMY EXEC PGM=IEFBR14
If no JCL error occurred, then pass your parameters into input stream
Code:
//. . . . . . . . . . . . . . . . .
//MYPROC PROC DS1=NULLFILE,
// DS2=NULLFILE,
// . . . . . . . . . . . . . . . . .
// DS25=NULLFILE
//SORT PGM=SORT
//. . . . . . . . . . . . . . . . .
//DSN1 DD DISP=SHR,DSN=&DS1
//. . . . . . . . . . . . . . . . .
//DSN25 DD DISP=SHR,DSN=&DS25
//. . . . . . . . . . . . . . . . .
//SYSIN DD *,SYMBOLS=(EXECSYS)
. . . . . . . . . . . . . . . .
HEADER1=(C'Data taken from DSN=&DS1'),
. . . . . . . . . . . . . . . .
BUILD=(…,C'&DS25',...),
. . . . . . . . . . . . . . . . .
etc.
Back to top
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1348 Location: Bamberg, Germany
System Symbol Support is depending on Job Class. So check if there is one that has this enabled. If that's the case (although I tend to use parm EXECSYS as well) proceed with:
if there is nothing you would like to use from current settings outside of the Job.
Back to top
Please enable JavaScript!