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
 

 

Counting Matched Records and writing alonwith a new record

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

New User


Joined: 12 May 2008
Posts: 13
Location: Hartford

PostPosted: Wed Jul 30, 2008 12:52 am    Post subject: Counting Matched Records and writing alonwith a new record
Reply with quote

Hello All,

I have matching input records.

First 4 bytes is the Key.

AAAA 12 234
AAAA 32 122
AAAA 54 344
AAAA 54 567
AAAA 21 876
BBBB 11 123
BBBB 12 111
BBBB 13 222
XXXX 12 456
XXXX 10 987
XXXX 14 789
XXXX 78 765

The LRECL is 11. The input file Keys are in sorted order

I require the output file having records having the Matched Keys which are = 4 or greater than 4..so my output file will look alike
means when next keys comes in i would like to see the count of matching records which are greater than 4.

AAAA 12 234
AAAA 32 122
AAAA 54 344
AAAA 54 567
AAAA 21 876
Count 5
XXXX 12 456
XXXX 10 987
XXXX 14 789
XXXX 78 765
Count 4.

Thanks,
Vikas
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 Jul 30, 2008 1:09 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN DD DSN=...  input file (FB/11)
//OUT DD DSN=...  output file (FB/11)
//TOOLIN   DD    *
SELECT FROM(IN) TO(OUT) ON(1,4,BI) HIGHER(3) USING(CTL1)
/*
//CTL1CNTL DD *
  OPTION COPY
  OUTFIL FNAMES=OUT,REMOVECC,
    SECTIONS=(1,4,
      TRAILER3=('COUNT ',COUNT=(EDIT=(IT))))
/*
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 Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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