Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Reading dataset from a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Reading dataset from a dataset
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    Post subject:
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    Post subject: Reply to: Reading dataset from a dataset
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    Post subject: Reply to: Reading dataset from a dataset
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: 6967
Location: porcelain throne

PostPosted: Fri Mar 21, 2008 4:07 pm    Post subject:
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    Post subject: Reply to: Reading dataset from a dataset
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    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 Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Need help in reading and validating a... ABINAYATHULASI COBOL Programming 8 Tue Apr 18, 2017 11:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us