IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Including serial number using SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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

Superior Member


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

PostPosted: Wed Jul 25, 2007 11:00 am
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
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
Reply with quote

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

Superior Member


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

PostPosted: Wed Jul 25, 2007 9:03 pm
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

Superior Member


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

PostPosted: Sat Jul 28, 2007 3:40 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top