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

Reading dataset from a dataset


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

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Thu Mar 20, 2008 8:21 pm
Reply with quote

Hi,

My scenario is that, my dataset consists of other dataset names as inputs. I just want to read this input dataset and combine all this datasets into a single dataset. Is it possible using DFSORT?

Ex:- My dataset name, XXX00D.PB.ASHOK.FILE - This dataset consists of
input as, XXX00D.PB.ASHOK.INPUT1
XXX00D.PB.ASHOK.INPUT2
XXX00D.PB.ASHOK.INPUT3 and so on. I can't read these inputs directly. I can source only this XXX00D.PB.ASHOK.FILE dataset from which i need to combine all the records from these three inputs,
XXX00D.PB.ASHOK.INPUT1
XXX00D.PB.ASHOK.INPUT2
XXX00D.PB.ASHOK.INPUT3 as single input.

Regards,
K.Ashok Kumar.
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Thu Mar 20, 2008 9:43 pm
Reply with quote

Someone who is a wizard with SORT can figure out a way to insert these names into a set of JCL records giving an IEBGENER copy job for the INTRDR. Please wait for assistance.

Or you can code a simple PGM to do it yourself.
Back to top
View user's profile Send private message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Thu Mar 20, 2008 9:54 pm
Reply with quote

Hi Dennis,

If there is a solution using DFSORT, my furthur task will be easier.

Or else, no probs if there is any alternative solution for the same Using JCL + SAS or JCL+COBOL Code. Hence, Could you please share COBOL or SAS program to resolve the same. I will keep this in my hand as an alternative solution.

Thanks in Advance,
Ashok Kumar.K
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Mar 20, 2008 10:23 pm
Reply with quote

ashok4u_it,

The following DFSORT JCL will build the Dynamic JCL and submit the job via intrdr which will copy all the datasets to a single dataset.

Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
XXX00D.PB.ASHOK.INPUT1                                     
XXX00D.PB.ASHOK.INPUT2                                     
XXX00D.PB.ASHOK.INPUT3                                     
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(2,2),RLSE)
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD))       
  OUTFIL IFOUTLEN=80,                                     
         IFTHEN=(WHEN=(81,8,ZD,EQ,1),                     
         BUILD=(C'//SORTIN   DD DISP=SHR,',1,44,80:X)),   
         IFTHEN=(WHEN=NONE,                               
         BUILD=(C'//         DD DISP=SHR,',1,44,80:X))     
/*                                                       
//STEP0200 EXEC  PGM=ICEMAN             
//SYSOUT   DD SYSOUT=*                   
//SYSIN    DD *                         
   SORT FIELDS=COPY                     
/*                                       
//SORTOUT  DD SYSOUT=*                   
//SORTIN   DD DATA,DLM=$$               
//TIDXXXXA JOB 'COPY',                   
//             CLASS=A,                 
//             MSGCLASS=Y,               
//             MSGLEVEL=(1,1),           
//             NOTIFY=TID               
//*                                     
//STEP0100 EXEC  PGM=ICEMAN             
//SYSOUT   DD SYSOUT=*                   
//SORTOUT  DD DSN=OUTPUT OF ALL DATASETS,
//            DISP=(NEW,CATLG,DELETE),   
//            UNIT=SYSDA,               
//            SPACE=(CYL,(X,Y),RLSE)     
//SYSIN    DD *                         
  SORT FIELDS=COPY                       
/*                                       
$$                                       
//         DD DSN=&&T1,DISP=(OLD,PASS)   


The output from the above job is
Code:

//TIDXXXXA JOB 'COPY',                         
//             CLASS=A,                       
//             MSGCLASS=Y,                     
//             MSGLEVEL=(1,1),                 
//             NOTIFY=TID                     
//*                                           
//STEP0100 EXEC  PGM=ICEMAN                   
//SYSOUT   DD SYSOUT=*                         
//SORTOUT  DD DSN=OUTPUT OF ALL DATASETS,     
//            DISP=(NEW,CATLG,DELETE),         
//            UNIT=SYSDA,                     
//            SPACE=(CYL,(X,Y),RLSE)           
//SYSIN    DD *                               
  SORT FIELDS=COPY                             
/*                                             
//SORTIN   DD DISP=SHR,XXX00D.PB.ASHOK.INPUT1 
//         DD DISP=SHR,XXX00D.PB.ASHOK.INPUT2 
//         DD DISP=SHR,XXX00D.PB.ASHOK.INPUT3 



Take a look at the sortout from step0200, once you verify that it generated the correct jcl , change the sortout statement in step0200 to the following


Code:

//SORTOUT  DD SYSOUT=(*,INTRDR)


and this will submit the dynamically created job.

Hope this helps...

Cheers
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Mar 21, 2008 4:07 pm
Reply with quote

thx Kolusu,

nice addition to my sort tricks.
Back to top
View user's profile Send private message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Fri Mar 21, 2008 8:38 pm
Reply with quote

Hi Kolusu,

Your reply worked fine.Thanks a lot for your immediate response.
Your reply taught me a lot in DFSORT.
Thank you very much.

Regards,
K.Ashok Kumar.
icon_biggrin.gif
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top