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
 

 

Processing 2 record format to find the record count

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
thirunarayanan_sampath

New User


Joined: 04 Dec 2006
Posts: 6
Location: Pune,India

PostPosted: Sun May 25, 2008 12:36 am    Post subject: Processing 2 record format to find the record count
Reply with quote

Hi all,

I currently have a situation where I have 2 fixed length file with record format Type1 and Type2 respectively:-

File1

key1,field11, field12, Type2-record-count

File2

key1,field21, field22


So for each record in File1 there could be multiple record in File2
which are linked through the key1.

I need to populate 'Type2-record-count' with the no. of occurances of records in file2.

Is is possible to use a ICETOOL to solve this problem. Can you please suggest me an idea.

Thanks and Regards,
Thiru
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun May 25, 2008 8:56 pm    Post subject:
Reply with quote

Please show an example of the records in each input file (relevant fields only) and what you expect for output. If input file1 can have duplicates within it, show that in your example. If input file2 can have duplicates within it show that in your example. Explain the rules for getting from input to output.

Give the RECFM and LRECL of the input files. Give the starting position, length and format of each relevant field in each input file.
Back to top
View user's profile Send private message
thirunarayanan_sampath

New User


Joined: 04 Dec 2006
Posts: 6
Location: Pune,India

PostPosted: Wed Jun 04, 2008 9:35 am    Post subject: Reply to: Processing 2 record format to find the record coun
Reply with quote

Hi Frank,

Please find the details of the file information and its records

File 1

Sort Code No of occurance in file2
(key field/no duplicates)

123456 02
123457 03
123458 04


File 2

Sort Code Party Id
(Key field/with dup) (duplicates allowed but not for same key field)

123456 1111111111
123456 2222222222

123457 1111111111
123457 3333333333
123457 5555555555

123458 1111111111
123458 1111111115
123458 1111111114
123458 1111111113
123458 1234567890
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Jun 04, 2008 8:53 pm    Post subject:
Reply with quote

Are you saying that you want to count the number of values for a key in file2, and overlay that count into the No of occurance field in file1 for that key?

In your example, are you showing the input for file1 and file2? If so, would the output for your example be:

Code:

123456                               02
123457                               03
123458                               05


Again: Give the RECFM and LRECL of the input files. Give the starting position, length and format of each relevant field in each input file.
Back to top
View user's profile Send private message
thirunarayanan_sampath

New User


Joined: 04 Dec 2006
Posts: 6
Location: Pune,India

PostPosted: Thu Jun 05, 2008 9:12 am    Post subject:
Reply with quote

Hi Frank,

Yes the requirement is to count the number of values for each key in file2 and overlay the count into '' No of occurance'' field in file1.

Yes Eventually, the count should be updated in the file1 and output is :-

file1

123456 02
123457 03
123458 05

LRECL of both files = 80
key field start at pos 1 for both files and of 6 characters in length.

''No of occurance'' field in file1 starting position = 7, length = 2

''Party id'' field in file2 starting posiyion = 7, length = 10
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jun 05, 2008 10:49 pm    Post subject:
Reply with quote

thirunarayanan_sampath,

The following DFSORT/ICETOOL JCl will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN1      DD *                                               
123456 02                                                     
123457 03                                                     
123458 04                                                     
//IN2      DD *                                               
123456 1111111111                                             
123456 2222222222                                             
123457 1111111111                                             
123457 3333333333                                             
123457 5555555555                                             
123458 1111111111                                             
123458 1111111115                                             
123458 1111111114                                             
123458 1111111113                                             
123458 1234567890                                             
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                               
  SORT FROM(IN2) USING(CTL1)                                 
  COPY FROM(IN1) USING(CTL2)                                 
  SPLICE FROM(T1) TO(OUT) ON(1,6,CH) KEEPNODUPS -             
  WITHALL WITH(01,09) USING(CTL3)                             
//CTL1CNTL DD *                                               
  SORT FIELDS=(1,6,CH,A)                                     
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,BUILD=(11X),             
  SECTIONS=(1,6,                                             
  TRAILER3=(1,6,3X,COUNT=(M11,LENGTH=2)))                     
//CTL2CNTL DD *                                               
  OUTFIL FNAMES=T1,BUILD=(1,9,2X)                             
//CTL3CNTL DD *                                               
  OUTFIL FNAMES=OUT,BUILD=(1,7,10,2)                         
/*


Hope this helps...

Cheers
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us