Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Syncsort Get the total number of records for a key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort Get the total number of records for a key
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10391
Location: italy

PostPosted: Tue Jun 16, 2009 5:42 pm    Post subject: Reply to: Get the total number of records for a key
Reply with quote

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

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Tue Jun 16, 2009 9:31 pm    Post subject:
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    Post subject: Reply to: Syncsort Get the total number of records for a key
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: 500
Location: USA

PostPosted: Tue Jun 16, 2009 10:09 pm    Post subject:
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    Post subject:
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    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 Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us