Senthilkumar k Warnings : 1 New User
Joined: 07 May 2009 Posts: 51 Location: Chennai
|
|
|
|
Hi All, I have requirement like below could someone help me on this please,
File 1 is,
Code: |
12345Q67567
54665M76855
66989A79080 |
File 2 is,
Output should be,
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. |
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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. |
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
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, |
|