View previous topic :: View next topic
|
Author |
Message |
Charles Wolters
New User
Joined: 30 Mar 2011 Posts: 48 Location: United States
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
Charles Wolters
New User
Joined: 30 Mar 2011 Posts: 48 Location: United States
|
|
|
|
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 |
|
|
|