Page 1 of 1

Converting IMS Unload as single Row Data Using JCL

PostPosted: Thu Jan 04, 2018 5:06 pm
by newbiemf
Hi all,

I need to convert IMS unload dataset become 1 single row using JCL, is it possible without using REXX or Program?

Example :
Input :
PARENT01
CHILD01AAAA
CHILD02BBBB
PARENT02
CHILD01AAAA
CHILD02BBBB
CHILD03CCCC
CHILD04DDDD
PARENT03
CHILD01AAAA
PARENT04
CHILD01AAAA
CHILD02BBBB
CHILD03CCCC
CHILD04DDDD

Result :
PARENT01CHILD01AAAA
PARENT01CHILD02BBBB
PARENT02CHILD01AAAA
PARENT02CHILD02BBBB
PARENT02CHILD03CCCC
PARENT02CHILD04DDDD
PARENT03CHILD01AAAA
PARENT04CHILD01AAAA
PARENT04CHILD02BBBB
PARENT04CHILD03CCCC
PARENT04CHILD04DDDD


Thanks for your help!!!

Re: Converting IMS Unload as single Row Data Using JCL

PostPosted: Thu Jan 04, 2018 5:55 pm
by NicC
using JCL, is it possible without using REXX or Program?

Absolutely not. JCL does not manipulate data - it simple tells the operating system that you want to execute some programs and the resources that the programs need.
Programs manipulate data and the program that you want is your sort utility - DFSort or Syncsort (look at the messages produced by your sort product to determine which it is). You should look at the RESIZE operator to start with.

I have assumed that you are using DFSort so have moved your topic there. If it is not then please let us know and it will be moved to the correct part of the forum.

Re: Converting IMS Unload as single Row Data Using JCL

PostPosted: Fri Feb 09, 2018 11:57 pm
by Aki88
Hello NicC,

RESIZE indeed is suited for this kind of task, but the problem is trickier because the number of records under each PARENT (sic.) are variable, hence it'd be difficult to group them into a fixed LRECL (which is needed in case of RESIZE).

Aside newbiemf, if this requirement is still open, then, solution requires a bit of code to achieve the output.
Use 'IFTHEN=(WHEN=GROUP' coupled with BEGIN and PUSH, to PUSH the PARENT (sic.) value for each grouped record.

Now you have the data in requisite format; use simple 'SORT FIELDS=COPY', with OUTFIL BUILD (if needed) to trim data, and voila.