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
 

 

Including serial number using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Itanium

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Tue Jul 24, 2007 7:03 pm    Post subject: Including serial number using SYNCSORT
Reply with quote

Below is my input
AAAAAAA
AAAAAAA
AAAAAAA
BBBBBBB
BBBBBBB
BBBBBBB
CCCCCC
CCCCCC

and the output shud look like,
AAAAAAA 001
AAAAAAA 002
AAAAAAA 003
BBBBBBB 001
BBBBBBB 002
BBBBBBB 003
CCCCCC 001
CCCCCC 002

Thanks.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jul 25, 2007 9:54 am    Post subject:
Reply with quote

Itanium

Here is the SORT CARD for your requirement.
Code:
SORT FIELDS=COPY
OUTREC OVERLAY=(8:SEQNUM,3,PD)
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jul 25, 2007 9:56 am    Post subject:
Reply with quote

sorry data format shd be ZD not PD,
Code:
FIELDS=COPY
OUTREC OVERLAY=(8:SEQNUM,3,ZD)
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jul 25, 2007 11:00 am    Post subject:
Reply with quote

krisprems,
This
krisprems wrote:
Code:
FIELDS=COPY
OUTREC OVERLAY=(8:SEQNUM,3,ZD)

will not work for OPs request. This SORT'll append sequence no. in asscending order in output irrespective of where input-records change their alphabetic-sequence.

Look the output, OP has posted:
AAAAAAA 001
AAAAAAA 002
AAAAAAA 003
BBBBBBB 001
BBBBBBB 002
BBBBBBB 003
CCCCCC 001
CCCCCC 002

I hope you got it, when input records change from AAAAAAA to BBBBBBB etc. , sequence no. in output has to start from '001'.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jul 25, 2007 1:16 pm    Post subject:
Reply with quote

Thanks for awakening me anuj icon_cool.gif
Itanium
Here is the sort card for your reuquest
Code:
//*******************************************************               
//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
AAAAAAA                                                                 
AAAAAAA                                                                 
AAAAAAA                                                                 
BBBBBBB                                                                 
BBBBBBB                                                                 
BBBBBBB                                                                 
CCCCCCC                                                                 
CCCCCCC                                                                 
/*                                                                     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
           SORT FIELDS=COPY                                             
           OUTREC OVERLAY=(9:SEQNUM,3,ZD,RESTART=(1,7))                 
/*                                                                     

The o/p SORTOUT conatins
Code:
----+----1-
AAAAAAA 001
AAAAAAA 002
AAAAAAA 003
BBBBBBB 001
BBBBBBB 002
BBBBBBB 003
CCCCCCC 001
CCCCCCC 002
Back to top
View user's profile Send private message
Itanium

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Wed Jul 25, 2007 4:22 pm    Post subject:
Reply with quote

This works...Thanks a lot
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jul 25, 2007 9:03 pm    Post subject:
Reply with quote

krisprems wrote:
Thanks for awakening me anuj icon_cool.gif

You're welcome icon_wink.gif
Code:
 OUTREC OVERLAY=(9:SEQNUM,3,ZD,RESTART=(1,7))

Was expecting RESTART parameter only. icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sat Jul 28, 2007 3:40 pm    Post subject:
Reply with quote

anuj_model wrote:
Was expecting RESTART parameter only.

Don't we have some other parameter in SORT to serve the same purpose?
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
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 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