MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Writing Dynamic PDS members based on Input file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Wed Apr 09, 2008 10:24 am    Post subject: Writing Dynamic PDS members based on Input file Reply with quote

Hi,

I am really sorry if you feel Im posting this without browsing the existing threads. Im really running short of time, so I will post this here and start looking for references. Either of it comes first, I will take it.

I need to read an Input file and based on its contents I need to write it to various Members in PDS

I/P File :
********************************* Top of Data **********************************
PZACR001;COB;DEL
PZACX001;COB;DEL
PZAER002;EZT;DEL
PZAER003;EZT;DEL
******************************** Bottom of Data ********************************

Output will be on various members of PDS. Each type will have its own PDS. For the above example

MYID.TEST.PDS(COBOL) should have

-SEL PZACR001, EXEC
-SEL PZACX001, EXEC
-END

MYID.TEST.PDS(EASYTRV) should have

-SEL PZAER002, EXEC
-SEL PZAER003, EXEC
-END

Like this based on Input I need to write onto 8 Diff PDS members.

Thanks
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 09, 2008 11:02 am    Post subject: Reply with quote

arvibala,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                       
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                   
PZACR001;COB;DEL                                 
PZACX001;COB;DEL                                 
PZAER002;EZT;DEL                                 
PZAER003;EZT;DEL                                 
PZAER004;XXX;DEL                                 
PZAER005;XXX;DEL                                 
PZAER006;XXX;DEL                                 
PZAER007;YYY;DEL                                 
PZAER008;YYY;DEL                                 
PZAER009;ZZZ;DEL                                 
PZAER009;ZZZ;DEL                                 
PZAER010;AAA;DEL                                 
PZAER011;BBB;DEL                                 
PZAER012;CCC;DEL                                 
//COBOL    DD DSN=your.existing.pds(COBOL),DISP=SHR
//EASYTRV  DD DSN=your.existing.pds(EASYTRV),DISP=SHR
//XXXLANG  DD DSN=your.existing.pds(XXXLANG),DISP=SHR
//YYYLANG  DD DSN=your.existing.pds(YYYLANG),DISP=SHR
//ZZZLANG  DD DSN=your.existing.pds(ZZZLANG),DISP=SHR
//AAALANG  DD DSN=your.existing.pds(AAALANG),DISP=SHR
//BBBLANG  DD DSN=your.existing.pds(BBBLANG),DISP=SHR
//CCCLANG  DD DSN=your.existing.pds(CCCLANG),DISP=SHR
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                   
  OUTFIL FNAMES=COBOL,INCLUDE=(10,3,CH,EQ,C'COB'),   
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X)               
  OUTFIL FNAMES=EASYTRV,INCLUDE=(10,3,CH,EQ,C'EZT'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X)               
  OUTFIL FNAMES=XXXLANG,INCLUDE=(10,3,CH,EQ,C'XXX'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X)               
  OUTFIL FNAMES=YYYLANG,INCLUDE=(10,3,CH,EQ,C'YYY'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X)               
  OUTFIL FNAMES=ZZZLANG,INCLUDE=(10,3,CH,EQ,C'ZZZ'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X)               
  OUTFIL FNAMES=AAALANG,INCLUDE=(10,3,CH,EQ,C'AAA'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X)               
  OUTFIL FNAMES=BBBLANG,INCLUDE=(10,3,CH,EQ,C'BBB'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X)               
  OUTFIL FNAMES=CCCLANG,INCLUDE=(10,3,CH,EQ,C'CCC'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X)               
/*


Hope this helps...
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Wed Apr 09, 2008 11:25 am    Post subject: Reply with quote

Thanks Kolusu,

Each PDS should have a footer like "-END" ... gimme the sample code for that too pls. I am reading DFSORT and hope to learn all these soon. Just a help this time.
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 09, 2008 11:36 am    Post subject: Reply with quote

arvibala,

use the following control cards

Code:

//SYSIN    DD *                                     
  SORT FIELDS=COPY                                   
  OUTFIL FNAMES=COBOL,INCLUDE=(10,3,CH,EQ,C'COB'),   
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X),               
  REMOVECC,TRAILER1=('-END')                         
  OUTFIL FNAMES=EASYTRV,INCLUDE=(10,3,CH,EQ,C'EZT'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X),               
  REMOVECC,TRAILER1=('-END')                         
  OUTFIL FNAMES=XXXLANG,INCLUDE=(10,3,CH,EQ,C'XXX'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X),               
  REMOVECC,TRAILER1=('-END')                         
  OUTFIL FNAMES=YYYLANG,INCLUDE=(10,3,CH,EQ,C'YYY'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X),               
  REMOVECC,TRAILER1=('-END')                         
  OUTFIL FNAMES=ZZZLANG,INCLUDE=(10,3,CH,EQ,C'ZZZ'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X),               
  REMOVECC,TRAILER1=('-END')                         
  OUTFIL FNAMES=AAALANG,INCLUDE=(10,3,CH,EQ,C'AAA'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X),               
  REMOVECC,TRAILER1=('-END')                         
  OUTFIL FNAMES=BBBLANG,INCLUDE=(10,3,CH,EQ,C'BBB'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X),               
  REMOVECC,TRAILER1=('-END')                         
  OUTFIL FNAMES=CCCLANG,INCLUDE=(10,3,CH,EQ,C'CCC'),
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X),               
  REMOVECC,TRAILER1=('-END')                         
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Thu Apr 10, 2008 8:54 am    Post subject: Reply with quote

Hi Kolusu,

I am getting S213 Abend. I guess its something to do with DISP parameter. Since all belongs to same PDS, we will have internal OPEN / CLOSE problem. I am working on it to correct it.

Thanks
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Apr 10, 2008 10:33 am    Post subject: Reply with quote

arvibala,

Just realized that you canNOT use OUTFIL to write to PDS members in parallel. You can do that with regular sequential data sets or with PDSE members, but NOT with PDS members.

Use the following JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
PZACR001;COB;DEL                                         
PZACX001;COB;DEL                                         
PZAER002;EZT;DEL                                         
PZAER003;EZT;DEL                                         
PZAER004;XXX;DEL                                         
PZAER005;XXX;DEL                                         
PZAER006;XXX;DEL                                         
PZAER007;YYY;DEL                                         
PZAER008;YYY;DEL                                         
PZAER009;ZZZ;DEL                                         
PZAER009;ZZZ;DEL                                         
PZAER010;AAA;DEL                                         
PZAER011;BBB;DEL                                         
PZAER012;CCC;DEL                                         
//SORTOUT  DD DSN=&&T,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *                                         
  SORT FIELDS=(10,3,CH,A)                               
  OUTFIL REMOVECC,                                       
  BUILD=(C'-SEL ',1,8,C', EXEC',80:X),                   
  SECTIONS=(10,3,                                       
  HEADER3=('./ ADD    NAME=',10,3,C'LANG',80:X),         
  TRAILER3=('-END'))                                     
/*                                                       
//STEP0200 EXEC PGM=IEBUPDTE,PARM=NEW   
//*                                     
//SYSUT2   DD DSN=your.existing.pds,     
//            DISP=SHR                 
//SYSPRINT DD SYSOUT=*                 
//SYSIN    DD DSN=&&T,DISP=(OLD,PASS)   
//*


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group