IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Split 1 record in multiple records


 
IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Use [URL] BBCode for Links
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

Global Moderator


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

PostPosted: Thu Mar 27, 2014 12:09 am
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
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
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Splice JCL into one record for DD sta... SYNCSORT 2
No new posts Need to split single line into two li... DFSORT/ICETOOL 7
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Break a record into fields, each fiel... SYNCSORT 2
No new posts Creating a single-record file with CO... DFSORT/ICETOOL 8

Back to Top