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
 

 

Split 1 record in multiple records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Wed Mar 26, 2014 11:45 pm    Post subject: Split 1 record in multiple records
Reply with quote

I have a data set of patient records for a specific HMO and for each patient I have a diagnosis code for each health care episode that the patient has had with the HMO in the period 2007 to 2013. There is a huge variation in the number of health care episodes between patients where one patient might have one episode in the seven year period and another might have 200 health care episodes in the seven year period. The diagnosis fields are all six characters in length and the fields are defined to be character. If the patient had six health care episodes from 2007 to 2013 then the patient record would look like:

534567304574E89876700213V65010622139

What I need to do is change the wide records into "skinny" ones so that I have one diagnosis code per record. The record above should be transformed into:

534567
304574
E89876
700213
V65010
622139

I looked at the post http://ibmmainframes.com/post-55345.html
where ICETOOL was being used to split one record into several records but in that post the records were fixed length where I am dealing with varying length records. Assuming ICETOOL can still be used to do this task can someone point me to the appropriate keywords in the DFSORT documentation.

Chas Wolters
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1624
Location: NY,USA

PostPosted: Thu Mar 27, 2014 12:09 am    Post subject:
Reply with quote

May be, I could think for converting VB to FB and then use the below SORT CARD,

Code:
//SPL1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPUT1 DD DSN=... input file (FB/52)
//OUTPUT1 DD DSN=... output file (FB/13)
//TOOLIN DD *
RESIZE FROM(INPUT1) TO(OUTPUT1) TOLEN(13)


e.g. TOLEN(13) indicates an output length of 13. RESIZE automatically resizes each 52-byte input record to four
13-byte output records.
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 27, 2014 1:01 am    Post subject:
Reply with quote

Charles Wolters,

Use the following DFSORT/ICETOOL JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                   
//TOOLMSG  DD SYSOUT=*                         
//DFSMSG   DD SYSOUT=*                         
//IN       DD *                               
534567304574E89876700213V65010622139           
//OUT      DD SYSOUT=*                         
//TOOLIN   DD *                               
  RESIZE FROM(IN) TO(OUT) TOLEN(6) USING(CTL1)
//CTL1CNTL DD *                               
  OUTFIL OMIT=(1,6,CH,EQ,C' ')                 
//*


Output
Code:

534567
304574
E89876
700213
V65010
622139
Back to top
View user's profile Send private message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Thu Mar 27, 2014 1:20 am    Post subject: Re: Splitting one record into several records
Reply with quote

Kolusu,

I used your code on a subset of my data set and the output is exactly what I desired. I never would have thought that major reshaping of a data set could be done in just a few lines of code. Thank you for your assistance.

Chas
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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