Converting IMS Unload as single Row Data Using JCL



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Converting IMS Unload as single Row Data Using JCL

Postby newbiemf » Thu Jan 04, 2018 5:06 pm

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!!!
newbiemf
 
Posts: 1
Joined: Thu Jan 04, 2018 4:57 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Converting IMS Unload as single Row Data Using JCL

Postby NicC » Thu Jan 04, 2018 5:55 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
newbiemf (Sat Feb 10, 2018 11:48 am)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Converting IMS Unload as single Row Data Using JCL

Postby Aki88 » Fri Feb 09, 2018 11:57 pm

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.

These users thanked the author Aki88 for the post:
newbiemf (Sat Feb 10, 2018 11:48 am)
Aki88
 
Posts: 381
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 36 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post