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

Is it possible to do arithmatic operation on two $ fields ??


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

New User


Joined: 28 Nov 2007
Posts: 63
Location: Chennai

PostPosted: Tue Jun 24, 2008 12:12 pm
Reply with quote

Hi all,

could any one send me the SORT card to do some arithmatic operation on two fields having $ values.

ex :-


POS 4 to 9 10 to 14

i/p $25.40 $20.30

and i need the output from location 16 to 20.

please let me know if anyone got the answer.


Thanks,
Siva
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 24, 2008 12:22 pm
Reply with quote

Hello,

$20.30 will not fit in pos 10-14.

What happens if there is a value less than $10 or over $100?

Please post more complete example data.
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 63
Location: Chennai

PostPosted: Tue Jun 24, 2008 12:30 pm
Reply with quote

Hi dick,

Thanks for the reply....

I dont have much more idea abt the SORT card. But my requirement is to do some addition or substraction on the $ values.

So for a simple understanding i only gave like that.

So could u please let me know more abt how to do the task with some example.

Thanks in advance

Best Regards,
Siva
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Jun 24, 2008 3:06 pm
Reply with quote

Hi,

here's some examples

Code:
//S1       EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
$19.31 $99.32                                                           
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD    *                                                     
  OPTION COPY                                                           
  OUTREC OVERLAY=(16:01,6,UFF,SUB,8,6,UFF,EDIT=(S$TT.TT),SIGNS=(,-))   
/*                                                                 





Code:
//S1       EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
$99.31 $99.32                                               
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD    *                                         
  OPTION COPY                                               
  OUTREC OVERLAY=(16:01,6,UFF,ADD,8,6,UFF,EDIT=($TTT.TT))   
/*                                                         


Gerry
Back to top
View user's profile Send private message
siva102

New User


Joined: 28 Nov 2007
Posts: 63
Location: Chennai

PostPosted: Tue Jun 24, 2008 4:34 pm
Reply with quote

Thanks gerry.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jun 24, 2008 8:02 pm
Reply with quote

Siva,

For more information on doing arithmetic with DFSORT, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.10?DT=20060615173822

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts Converting unpacked fields to pack us... SYNCSORT 4
No new posts Data for newly added fields not displ... IMS DB/DC 6
This topic is locked: you cannot edit posts or make replies. SUM FIELDS=NONE in reverse - Get dupl... DFSORT/ICETOOL 9
Search our Forums:

Back to Top