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

Syncsort Get the total number of records for a key


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
eytellene

New User


Joined: 19 May 2009
Posts: 16
Location: Philippines

PostPosted: Tue Jun 16, 2009 5:37 pm
Reply with quote

Hi Experts,

Is it possible for syncsort to get the number of records of the same key, and output the record key and its record count.

Thanks icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jun 16, 2009 5:42 pm
Reply with quote

yes
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Jun 16, 2009 9:31 pm
Reply with quote

eytellene,

What is the position and length of your key field(s)?
Is the data set fixed or variable?
Back to top
View user's profile Send private message
eytellene

New User


Joined: 19 May 2009
Posts: 16
Location: Philippines

PostPosted: Tue Jun 16, 2009 9:50 pm
Reply with quote

Hi Alissa,

The datasets are fixed.

Input 1: file length 90, key 1 is in position 1, 12 bytes. key 2 is position 13, integer
11111111111112
22222222222210
33333333333322

Input 2: file length 50, key 1 is in position 1,12 bytes; key 2 position 13,integer

11111111111112
11111111111112
11111111111112
22222222222210
22222222222210
33333333333322

Output must be file length, 30 ,key 1 position 1,12 bytes,key 2 position 13, integer;number of records in file 2 with the same key 1 and 2 in file 1 position 15

1111111111111203
2222222222211002
3333333333332201

Thanks in advance icon_biggrin.gif
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Jun 16, 2009 10:09 pm
Reply with quote

Here is a SyncSort for z/OS job that will do what you asked:
Code:
//STEP1  EXEC PGM=SORT       
//SORTJNF1 DD DSN=INPUT1 (FB/90)             
//SORTJNF2 DD DSN=INPUT2 (FB/50)           
//SORTOUT  DD DSN=OUTPUT (FB/30)
//SYSOUT   DD SYSOUT=*         
//SYSIN    DD *                                             
  JOINKEYS FILES=F1,FIELDS=(1,12,A,13,2,A)               
  JOINKEYS FILES=F2,FIELDS=(1,12,A,13,2,A)               
  REFORMAT FIELDS=(F1:1,14)                             
  SORT FIELDS=COPY                                       
  OUTREC OVERLAY=(15:SEQNUM,2,ZD,RESTART=(1,14),30:X)   
  OUTFIL SECTIONS=(1,14,                                 
      TRAILER3=(1,30)),                                 
      REMOVECC,NODETAIL                                 
/*   
Back to top
View user's profile Send private message
eytellene

New User


Joined: 19 May 2009
Posts: 16
Location: Philippines

PostPosted: Wed Jun 17, 2009 10:29 am
Reply with quote

Hi Alissa,

Thanks a lot icon_biggrin.gif

It worked .....!!!!!! icon_biggrin.gif
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 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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
Search our Forums:

Back to Top