View previous topic :: View next topic
Author
Message
sudhakarraju New User Joined: 05 May 2005Posts: 31
Input
ABC001 12345
ABC002 12345
ABC003 12345
ABC004 12345
ABC001 23456
ABC002 23456
ABC003 23456
ABC004 23456
Output needed
ABC001 12345
ABC002 12345
ABC001 23456
ABC002 23456
ABC003 12345
ABC004 12345
ABC003 23456
ABC004 23456
Back to top
vasanthz Global Moderator Joined: 28 Aug 2007Posts: 1742 Location: Tirupur, India
Is this supposed to be a puzzle that we figure out and provide a working code?
If you don't even care to explain, how do you expect people to spend their time and do your work for you?
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
sudhakarraju,
I believe you have been here long enough to know guesswork is not entertained here. You have posted little information for others to help you.
Back to top
sudhakarraju New User Joined: 05 May 2005Posts: 31
Hi,
Sorry about that.
I have two fields, group no and group id in the dataset.
I can have multiple group numbers but have to keep the group numbers ABC001 & ABC002 together for the same group id and ABC003 & ABC004 together for the same group id. I don't need to worry about the order of the other group numbers.
Thanks.
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
sudhakarraju wrote:
have to keep the group numbers ABC001 & ABC002 together for the same group id and ABC003 & ABC004 together for the same group id
If I am not mistaken, your input has it grouped already. It is not clear what is the logic behind this re-grouping.
It might help if you can show a better example, with "other" groups so the difference is visible.
Back to top
sudhakarraju New User Joined: 05 May 2005Posts: 31
I was able to achieve this using ICETOOL but was just wondering if there is a shorter way.
//SETP01 EXEC PGM=ICETOOL
//TOOLIN DD *
MODE CONTINUE
SORT FROM(DDO1) TO(DDO2) USING(DDC1)
SORT FROM(DDO2) TO(DDO3) USING(DDC2)
COPY FROM(DDO3) TO(DDO4) USING(DDC3)
//DDO1 DD DSN=TEST.INPUT,
// DISP=SHR
//DDO2 DD DSN=&&TEMP2,DISP=(NEW,PASS),
// UNIT=SYSDA,SPACE=(CYL,(50,50),RLSE)
//DDO3 DD DSN=&&TEMP3,DISP=(NEW,PASS),
// UNIT=SYSDA,SPACE=(CYL,(50,50),RLSE)
//DDO4 DD SYSOUT=*
//DDC1CNTL DD *
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(2,6,CH,EQ,C'MSC001',OR,2,6,CH,EQ,C'MSC002'),
BUILD=(1,1800,C'A')),
IFTHEN=(WHEN=(2,6,CH,EQ,C'MSC003',OR,2,6,CH,EQ,C'MSC004'),
BUILD=(1,1800,C'B')),
IFTHEN=(WHEN=NONE,
BUILD=(1,1800,C'X '))
//DDC2CNTL DD *
SORT FIELDS=(1801,1,A,52,17,A,2,6,A),FORMAT=CH
//DDC3CNTL DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,1800)
//*
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Plain SORT, do the DC1 processing in INREC, the SORT from DC2 in SORT and the DC3 in OUTREC.
User OVERLAY instead of the BUILD in the DC1 replacement.
Back to top
Please enable JavaScript!