Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Capture DSN names through SORT / IDCAMS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
reach2abhinavtyagi

New User


Joined: 04 Aug 2016
Posts: 3
Location: India

PostPosted: Tue Nov 05, 2019 7:33 pm    Post subject: Capture DSN names through SORT / IDCAMS
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

Senior Member


Joined: 21 Sep 2010
Posts: 2298
Location: NY,USA

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

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

Active Member


Joined: 29 Apr 2008
Posts: 603
Location: Maryland

PostPosted: Tue Nov 05, 2019 9:14 pm    Post subject: Re: Capture DSN names through SORT / IDCAMS
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

Active Member


Joined: 29 Apr 2008
Posts: 603
Location: Maryland

PostPosted: Tue Nov 05, 2019 10:04 pm    Post subject:
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: 3
Location: India

PostPosted: Thu Nov 07, 2019 8:05 pm    Post subject: Reply to: Capture DSN names through SORT / IDCAMS
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

Active Member


Joined: 29 Apr 2008
Posts: 603
Location: Maryland

PostPosted: Thu Nov 07, 2019 9:04 pm    Post subject: Re: Reply to: Capture DSN names through SORT / IDCAMS
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

Senior Member


Joined: 21 Sep 2010
Posts: 2298
Location: NY,USA

PostPosted: Fri Nov 08, 2019 2:11 am    Post subject:
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

Active Member


Joined: 29 Apr 2008
Posts: 603
Location: Maryland

PostPosted: Fri Nov 08, 2019 6:05 pm    Post subject: Re: Reply to: Capture DSN names through SORT / IDCAMS
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

New User


Joined: 15 Aug 2015
Posts: 41
Location: Germany

PostPosted: Tue Nov 12, 2019 12:51 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IDCAMS & LISTCAT with ddnames reach2abhinavtyagi JCL & VSAM 1 Thu Nov 07, 2019 8:11 pm
No new posts Convert mainframe data to .csv format... karan_reddy DFSORT/ICETOOL 10 Sat Nov 02, 2019 2:09 am
No new posts One-One matching using SORT dearlux SYNCSORT 14 Fri Oct 11, 2019 12:11 am
No new posts Create Dynamic Sort card with Omit co... balaji81_k DFSORT/ICETOOL 9 Thu Sep 26, 2019 10:06 pm
No new posts need assistance on a sort rajiv rengasamy SYNCSORT 11 Fri Jul 26, 2019 8:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us