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
 

 

performing airthmetic with numeric fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Kmr.deepakcs

New User


Joined: 11 Oct 2013
Posts: 37
Location: India

PostPosted: Thu Oct 24, 2013 5:54 pm    Post subject: performing airthmetic with numeric fields
Reply with quote

Dear experts,
I have one query which is as follows.

I was studying the topic arithmetic with numeric fields by sort.
The point is that i stuck on one thing where it saying when ua want to subtract a pd data to another data you have to check its decimal point before doing arithmetic calculation.
"In order to do arithmetic on these fields, you must ensure that the integer and decimal parts of the numbers match up correctly. For example, in the first record, the first PD value is +1524900810 representing +15249008.10 and the second PD value is +20000 representing +20.000. In order to subtract the second PD value from the first PD value, you need to put them in the following forms:
+15249008.100
+00000020.000"
OUTREC FIELDS=(1,8,
5X,
((11,6,PD,MUL,+10),SUB,31,7,PD),
EDIT=(SI,III,III,IIT.TTT),SIGNS=(,-))
..and we have to multiply by 10 to check first pd decimal point.
Bt i am confusing how it will check decimal point after multiplied by 10.

Please clear me....

Deepak kumar
Back to top
View user's profile Send private message

Kmr.deepakcs

New User


Joined: 11 Oct 2013
Posts: 37
Location: India

PostPosted: Thu Oct 24, 2013 5:58 pm    Post subject:
Reply with quote

Code:
OUTREC FIELDS=(1,8,
     5X,
     ((11,6,PD,MUL,+10),SUB,31,7,PD),
       EDIT=(SI,III,III,IIT.TTT),SIGNS=(,-))
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1753
Location: Bloomington, IL

PostPosted: Thu Oct 24, 2013 6:13 pm    Post subject:
Reply with quote

"It" (i.e., your sort product) will not check the decimal point; packed decimal fields do not carry decimal points. In HLLs such COBOL and PL/I, there are various means of coding variables to ensure that packed decimal numbers are aligned properly. In *sort control cards, however, you must do it yourself; that is why you multiply the first number by 10; you know -- but have no means of sharing the information with *sort -- that it must be shifted one place to the left.
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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am


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