IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Capture DSN names through SORT / IDCAMS


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
reach2abhinavtyagi

New User


Joined: 04 Aug 2016
Posts: 7
Location: India

PostPosted: Tue Nov 05, 2019 7:33 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Tue Nov 05, 2019 8:47 pm
Reply with quote

Shouldn't the JOINKEYs solution help here?
ibmmainframes.com/viewtopic.php?t=67424&highlight=
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Tue Nov 05, 2019 9:14 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Tue Nov 05, 2019 10:04 pm
Reply with quote

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
View user's profile Send private message
reach2abhinavtyagi

New User


Joined: 04 Aug 2016
Posts: 7
Location: India

PostPosted: Thu Nov 07, 2019 8:05 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Nov 07, 2019 9:04 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Nov 08, 2019 2:11 am
Reply with quote

Quote:
Is it possible to reduce the number of steps to Max 3.

Why would JOINKEY's won't here?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Fri Nov 08, 2019 6:05 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1245
Location: Bamberg, Germany

PostPosted: Tue Nov 12, 2019 12:51 am
Reply with quote

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:
Code:
SYMBOLS=JCLONLY

if there is nothing you would like to use from current settings outside of the Job.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top