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 

Creating PDS members from a Seq file based on record count

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


Joined: 22 Aug 2005
Posts: 23
Topics: 4

PostPosted: Mon Nov 14, 2005 6:22 am    Post subject: Creating PDS members from a Seq file based on record count Reply with quote

Hi ,

I have a input dataset of LRECL=80, FB, 800 which contains 469268 record.
i want first 2700 record in the OUTPUTDATASET(MEM1) the next 2700 records in OUTOUTDATASET(MEM2) and so till the end of all the 469268 records.

it takes almost 544 members of a PDS, if iam right.


could you please guide me in how to do this.

Thanks


B.Stalin
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Nov 14, 2005 7:34 am    Post subject: Reply with quote

stalin,

Try this

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR INPUT DSN,
//            DISP=SHR
//MEM001   DD DSN=YOUR PDS(MEM001),
//            DISP=SHR
//MEM002   DD DSN=YOUR PDS(MEM002),
//            DISP=SHR
...
code all your member allocations
//SYSIN  DD *
  SORT FIELDS=COPY
  OUTFIL FNAMES=MEM001,STARTREC=0001,ENDREC=2700
  OUTFIL FNAMES=MEM002,STARTREC=2701,ENDREC=5400
  OUTFIL FNAMES=MEM003,STARTREC=5401,ENDREC=8100
 ...
  code all your outfil names here
/*


Hope this helps...

Cheers

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


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Nov 15, 2005 1:03 am    Post subject: Reply with quote

Stalin,

On the same lines as Kolusu, here is one another way of doing the same thing.

Code:

//SYSIN   DD  *
  SORT FIELDS=COPY
  OUTFIL FNAMES=(MEM001, MEM002, MEM003....MEMnnn),SPLITBY=2700
/*


The rest of the JCL is same as Kolusu's solution.

Thanks,
Phantom
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Nov 15, 2005 11:58 am    Post subject: Reply with quote

Note that with SPLITBY=2700, the records will rotate back to the first member if there are any records left over. For example, if you had two members and 5405 records, records 1-2700 would go to member 1, records 2701-5400 would go to member 2, and records 5401-5405 would go back to member 1. So member 1 would have 1-2700 and 5401-5405 and member 2 would have 2701-5400. This may NOT be what's wanted.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
stalin
Beginner


Joined: 22 Aug 2005
Posts: 23
Topics: 4

PostPosted: Wed Nov 16, 2005 6:27 am    Post subject: Reply with quote

HI Kolusu , phantom and frank

Its not working.it gives the system abend code S213 with reason code 30.it means the dataset was kept opened while execution.what i have understood from this is, it opens the MEM001 of the PDS for writing and when it comes for MEM002 , it gives this message(as the PDS was opened earlier).Guide me if iam wrong.
i could able to write only one member.

please guide me more on this.

Thanks
Stalin
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Nov 16, 2005 7:00 am    Post subject: Reply with quote

Stalin,

What is the dataset disposition you are using for each member ? Do you get an error with DISP=SHR ?

Thanks,
Phantom
Back to top
View user's profile Send private message
stalin
Beginner


Joined: 22 Aug 2005
Posts: 23
Topics: 4

PostPosted: Wed Nov 16, 2005 7:03 am    Post subject: Reply with quote

Phantom ,
yes iam getting the error by using DISP=SHR
Back to top
View user's profile Send private message
stalin
Beginner


Joined: 22 Aug 2005
Posts: 23
Topics: 4

PostPosted: Wed Nov 16, 2005 7:09 am    Post subject: Reply with quote

Phantom, iam giving the code for your reference

//STEP01 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=A.B.C,DISP=SHR
//MEM001 DD DSN=A.B.C.D(MEM001),DISP=SHR
//MEM002 DD DSN=A.B.C.D(MEM002),DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=(MEM001),STARTREC=0001,ENDREC=2700
OUTFIL FNAMES=(MEM002),STARTREC=2701,ENDREC=5400
/*

similarly i have to code for 544 members.itried it out for first 2 members only, but still it failed.


Thanks
B.Stalin
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Nov 16, 2005 7:26 am    Post subject: Reply with quote

Stalin,

Change the DISP to OLD as below.

Code:
//MEM001 DD DSN=A.B.C.D(MEM001),DISP=OLD     
//MEM002 DD DSN=A.B.C.D(MEM002),DISP=OLD


Always put your code in between {code} and {/code}.
Back to top
View user's profile Send private message Send e-mail
stalin
Beginner


Joined: 22 Aug 2005
Posts: 23
Topics: 4

PostPosted: Wed Nov 16, 2005 11:02 pm    Post subject: Reply with quote

Hi Vkphani, Kolusu , phantom and frank

when i used DISP=SHR, its working good. i followed the technique of Phantom and found that all the 544 members have have the same content starting from the record 384449.it skips the previous records, why is this happining.

The input dataset contains 471448 reocrds and i want to split them into 2700 records( which almost take 544 dataset)

Please guide me
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Nov 17, 2005 5:41 am    Post subject: Reply with quote

Quote:

i followed the technique of Phantom and found that all the 544 members have have the same content starting from the record 384449.it skips the previous records, why is this happining.

The input dataset contains 471448 reocrds and i want to split them into 2700 records( which almost take 544 dataset)

stalin,

Frank already answered your question before. check this post

http://mvsforums.com/helpboards/viewtopic.php?p=25178#25178

Hope this helps...

Cheers

Kolusu
_________________
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 -> 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