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
 

 

How to add two records using icetool

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to add two records using icetool
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    Post subject:
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    Post subject:
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    Post subject: Thanks
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    Post subject:
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    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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
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 Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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