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
 

 

Count the record wit condtion and do overlay

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Count the record wit condtion and do overlay
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: 1476
Location: Chennai

PostPosted: Wed Jun 01, 2011 1:53 pm    Post subject:
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    Post subject:
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: 578
Location: USA

PostPosted: Wed Jun 01, 2011 8:52 pm    Post subject:
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    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 7 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 Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am


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