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

How to add two records using icetool


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kumarmca1

New User


Joined: 06 Jul 2009
Posts: 13
Location: chennai

PostPosted: Wed Dec 30, 2009 11:05 am
Reply with quote

Hi,

I want to add two records from the input file and write the sum (5 bytes interval) in the output file.

Ex:

000923456007789022222
000934567009870123456

My requirement is to sum the records

0009 - Record type leave as it is
23456+34567
0077890+0098701
22222+123456

My output should be
ie 0009580230176591

i heard about icetool. But i am not very much expertise on this. Could you please help me how to do this.

Note:


There will be no other record in the input file. Only two records.

Thanks for your help,
Muthu
Back to top
View user's profile Send private message
venkatesh83be

New User


Joined: 10 Aug 2009
Posts: 12
Location: Chennai

PostPosted: Wed Dec 30, 2009 11:53 am
Reply with quote

Hi Kumar,

Explain your requirement clearly -

I guess the 3rd sum value should be 22222 + 23456 - check that
Does 3rd sum value need not be written to output file ?

Thanks,
Venkat
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Wed Dec 30, 2009 11:58 am
Reply with quote

you can try sort also...

Code:

//S1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD *
000923456007789022222
000934567009870123456
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  SORT FIELDS=(1,04,ZD,A)
  SUM FIELDS=(5,5,ZD,10,5,ZD,15,6,ZD)
/*


output

Code:

000958023017659145672
Back to top
View user's profile Send private message
kumarmca1

New User


Joined: 06 Jul 2009
Posts: 13
Location: chennai

PostPosted: Wed Dec 30, 2009 12:40 pm
Reply with quote

Hi Genesis,

Thanks for your help. The above code worked fine. I got the expected result.
I also tried the different code using dfsort and got the same result. But your code is simple.

Here is the code i used

Code:
//STEP2    EXEC PGM=ICEMAN                                             
 //SYSOUT   DD SYSOUT=*                                                 
 //SORTIN   DD *                                                         
 D1 P1 M1 15 15 15                                                       
 D1 P1 M1 14 14 14                                                       
 //SORTOUT  DD DSN=DPSDZMU.SORT.ICE1,DISP=(,CATLG),                     
 //         DCB=(LRECL=18,RECFM=FB),SPACE=(CYL,(1,2),RLSE)               
 //SYSIN    DD *                                                         
  SORT FIELDS=(1,3,CH,A)                                                 
  OUTFIL REMOVECC,NODETAIL,                                             
  SECTIONS=(1,1,                                                         
  TRAILER3=(1,9,10:TOT=(10,2,SFF,EDIT=(TT)),                             
  13:TOT=(13,2,SFF,EDIT=(TT)),16:TOT=(16,2,SFF,EDIT=(TT)),18:18,1))     
 /*                                                                     



Again thanks for your help.

Cheers,
Muthu.
Back to top
View user's profile Send private message
kumarmca1

New User


Joined: 06 Jul 2009
Posts: 13
Location: chennai

PostPosted: Wed Dec 30, 2009 12:57 pm
Reply with quote

venkatesh83be wrote:
Hi Kumar,

Explain your requirement clearly -

I guess the 3rd sum value should be 22222 + 23456 - check that
Does 3rd sum value need not be written to output file ?

Thanks,
Venkat


Hi Venkatesh,

Sorry i have missed the third value.. i need the third value too. and the value you told is correct.
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top