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 

splitting a single record to 5 records.

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


Joined: 28 Sep 2005
Posts: 98
Topics: 33

PostPosted: Mon Apr 14, 2008 5:16 am    Post subject: splitting a single record to 5 records. Reply with quote

Hi,

I have an unload file of an ims database of 10500 VB length.I have to split the contents of seg3 and seg4 record contents in to 5 records each and i have to write under the seg3 & seg4 records

For example:If Seg3 record is of 10500 length, then let first 500 bytes be in seg3 and each 2500 bytes splitted and written to a separate record with header SEG31,SEG32,seg33,seg34 and same for seg4 records under the respective parent records.I can write a pgm for it,but it seems that sort will do better than the pgm.Please let me know how to perform this using sort tool.

Input file format:
seg0 Data
seg1 Data
Seg2 Data
seg3 Data
seg4 Data
seg5 Data
seg6 Data
seg7 Data


Output file:

seg0 Data
seg1 Data
Seg2 Data
seg3 Data
seg31 Data
seg32 Data
seg33 Data
seg34 Data

seg4 Data
seg41 Data
seg42 Data
seg43 Data
seg44 Data

seg5 Data
seg6 Data
seg7 Data




cheers,
vj
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu May 29, 2008 12:27 pm    Post subject: Reply with quote

vjkumk,


The following DFSORT JCL will give you the desired results

Code:


//STEP0100 EXEC PGM=ICEMAN                           
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DSN=your input vb file,           
//            DISP=SHR                               
//SORTOUT  DD DSN=Your output vb file,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                   
  OUTFIL IFTHEN=(WHEN=(1,2,BI,EQ,10500,AND,5,4,SS,EQ,C'SEG3,SEG4'),
         BUILD=(1,4,5,500,/,
                1,4,5,4,C'1',0505,2500,/,
                1,4,5,4,C'2',3005,2500,/,
                1,4,5,4,C'3',5505,2500,/,
                1,4,5,4,C'4',8005,2500))
/*


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