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

Count the record wit condtion and do overlay


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Wed Jun 01, 2011 11:41 am
Reply with quote

Hi All, I have requirement like below could someone help me on this please,

File 1 is,
Code:
12345Q67567
54665M76855
66989A79080


File 2 is,

Code:
23423536456


Output should be,
Code:
23423526456


If file has Q or M in position 6 then 1 count should be added and total count should reflect into the second file position 7.

In my example you can see that File 1 was having two records one with Q and another one with M. So, total count of records which was having Q or M is 2. So, File 2 should be updated with 2 instead of 3 in position 7.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Jun 01, 2011 1:53 pm
Reply with quote

Hello Senthil,
Indha job try panni parunga,

For files with FB80.

Code:
//JS020    EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=* ,                                               
//DFSMSG   DD SYSOUT=*                                                 
//F1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)       
//         DD DISP=OLD,DSN=WELLS.SORTOUT                             
//SORTIN   DD DISP=SHR,DSN=WELLS.SORTIN                               
//SORTOUT  DD DSN=WELLS.SORTOUT,DISP=OLD                             
//SYSOUT   DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
  COUNT FROM(SORTIN) WRITE(F1) DIGITS(1) WIDTH(80) USING(CTL1) -       
  TEXT('DUMMY ')                                                       
  COPY FROM(F1) TO(SORTOUT) USING(CTL2)                                 
/*                                                                     
//CTL1CNTL   DD *                                                       
  INCLUDE COND=(6,1,CH,EQ,C'Q',OR,6,1,CH,EQ,C'M')                       
/*                                                                     
//CTL2CNTL   DD *                                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,6,CH,EQ,C'DUMMY '),PUSH=(81:7,1))   
  OUTFIL INCLUDE=(1,6,CH,NE,C'DUMMY '),BUILD=(1,6,81,1,8,73)           
//SYSUDUMP DD SYSOUT=*                                                 
/*                   


Hope it helps.
Back to top
View user's profile Send private message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Wed Jun 01, 2011 4:27 pm
Reply with quote

Ya it worked Vasanth......Thanks for your Help....................... icon_smile.gif icon_smile.gif
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Jun 01, 2011 8:52 pm
Reply with quote

Senthilkumar k
What if the total number of records are more than 9, meaning 2 digits, where do you want to put that count?

Unless I am missing something, this can be easily done using single pass.

Thanks,
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top