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: 10326
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am

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