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 

Sequential file to PDS copy.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Sebanpj
Beginner


Joined: 04 Aug 2008
Posts: 9
Topics: 5
Location: BANGALORE

PostPosted: Thu Jan 01, 2009 2:07 am    Post subject: Sequential file to PDS copy. Reply with quote

Hi Friends,

Here is my requirement. I have a sequential file with data as given below.


Code:
001TEST.SEJ1I0.JCLLIB
002YPTEST.ASDF.QWERT
004FNTEST.QWERT.YUIOP
005C8TEST.REERT.DB2W.FRGT
........
001TEST.CDSF.POIKJ.VDRZ
002TEST.RESTER.WQER.VISTER
003CMTEST.WERTY.UIOP
----


I have to copy these records to different members of a new PDS based on the first 3 bytes. All records with '001' as first 3 bytes should be written to a member named DSN001. similarly,
with '002' to member DSN002,
with '003' to member DSN003.

this may go till '099' to member DSN099.

I tried some thing like this. but gave an error saying that space specification incorrect.

Code:
//JS10   EXEC PGM=IEBGENER           
//SYSPRINT DD SYSOUT=*               
//SYSUT1   DD DSN=MY.SEQ.FILE.LIB,   
//            DISP=SHR               
//SYSUT2   DD DSN=MY.PDS.FILE.LIB,   
//            DISP=SHR               
//SYSIN    DD *                       
GEN1  GENERATE MAXNAME=4,MAXGPS=3     
MEM1  MEMBER  NAME=DSN001           
GRP1  RECORD   IDENT=(3,'001',1)
MEM2  MEMBER  NAME=DSN002
GRP2  RECORD   IDENT=(3,'002',1)
MEM3  MEMBER  NAME=DSN003           
GRP3  RECORD   IDENT=(3,'003',1),
MEM4  MEMBER  NAME=DSN004           
GRP4  RECORD   IDENT=(3,'004',1)
/*


Eventhough i have used an existing file here(SYSUT2....DISP=SHR), Actualy my requirement is to create a new PDS and write into its members.

Please help me.

Can i handle this requirement of multiple members in a pds, using SYNCSORT or DFSORT utility also???
Actualy I tried something with
Code:
SORT FIELDS=COPY
      OUTFIL FILES=01,INCLUDE=(1,3,CH,EQ,C'001')


But I couldn't findout how to specify the DISP for SORTOF01, SORTOF02,SORTOF03......SORTOF99.

Please help me.
_________________
Thanks and Regards,
Sebastian Joseph
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jan 01, 2009 3:20 pm    Post subject: Reply with quote

Sebanpj,

DFSORT supports writing to PDS-E members simultaneously. Try this
Code:

//STEP0100 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=your seq file,DISP=SHR
//SORTOF01 DD DSN=YOUR EXISTING PDSE(MEM01),DISP=SHR
//SORTOF02 DD DSN=YOUR EXISTING PDSE(MEM02),DISP=SHR
//SORTOF03 DD DSN=YOUR EXISTING PDSE(MEM03),DISP=SHR
//SORTOF04 DD DSN=YOUR EXISTING PDSE(MEM04),DISP=SHR
//SORTOF05 DD DSN=YOUR EXISTING PDSE(MEM05),DISP=SHR
//SORTOF06 DD DSN=YOUR EXISTING PDSE(MEM06),DISP=SHR
....
//SORTOF99 DD DSN=YOUR EXISTING PDSE(MEM99),DISP=SHR
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTFIL FILES=01,INCLUDE=(1,3,CH,EQ,C'001')
  OUTFIL FILES=02,INCLUDE=(1,3,CH,EQ,C'002')
  OUTFIL FILES=03,INCLUDE=(1,3,CH,EQ,C'003')
  OUTFIL FILES=04,INCLUDE=(1,3,CH,EQ,C'004')
  OUTFIL FILES=05,INCLUDE=(1,3,CH,EQ,C'005')
  OUTFIL FILES=06,INCLUDE=(1,3,CH,EQ,C'006')
...
  OUTFIL FILES=99,INCLUDE=(1,3,CH,EQ,C'099')
//*


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
Sebanpj
Beginner


Joined: 04 Aug 2008
Posts: 9
Topics: 5
Location: BANGALORE

PostPosted: Sun Jan 04, 2009 3:04 pm    Post subject: Reply with quote

Hi Kolusu,

Yes it worked. Thank you very much for your suggestion.

The problem was that I was using a PDS as output in my JCL
Now I changed it to a PDSE or library and it worked.
_________________
Thanks and Regards,
Sebastian Joseph
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 -> Utilities 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