Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort Help to group fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
sudhakarraju

New User


Joined: 05 May 2005
Posts: 29

PostPosted: Thu Dec 29, 2016 1:38 am    Post subject: Syncsort Help to group fields
Reply with quote

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
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1458
Location: Azeroth

PostPosted: Thu Dec 29, 2016 2:31 am    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Thu Dec 29, 2016 2:34 am    Post subject:
Reply with quote

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
View user's profile Send private message
sudhakarraju

New User


Joined: 05 May 2005
Posts: 29

PostPosted: Thu Dec 29, 2016 3:05 am    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Thu Dec 29, 2016 4:17 am    Post subject:
Reply with quote

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
View user's profile Send private message
sudhakarraju

New User


Joined: 05 May 2005
Posts: 29

PostPosted: Thu Dec 29, 2016 8:51 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Thu Dec 29, 2016 9:03 pm    Post subject: Reply to: Syncsort Help to group fields
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us