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: 1506
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 Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 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


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