IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 1
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top