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
 

 

Easytrieve positive/neg numeric values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
shamus

New User


Joined: 22 Jul 2005
Posts: 7

PostPosted: Fri Oct 01, 2010 4:44 pm    Post subject: Easytrieve positive/neg numeric values
Reply with quote

Hi,
I read a file with 2 values, both numeric length 6, both will always be positive, but are not signed.

I want to subtract the second value from the first and display the result, if the result is negative, I need to show the Neg Sign.

I am having trouble showing the sign on the result, any suggestions?

I tried a mask, with no success. I am thinking I need to sign the values I read but dont know how this is done

Any help much appreciated
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Fri Oct 01, 2010 7:55 pm    Post subject:
Reply with quote

Hello,

Without studying the code, here is one way:

Define a signed field and compute this field as the subtraction of the 2 values. Then move this signed value to your output field definition.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2435
Location: Netherlands, Amstelveen

PostPosted: Sat Oct 02, 2010 2:55 pm    Post subject:
Reply with quote

IIRC, if you define your fields with decimal places e.g. "6 N 0"
Easytrev considers such fields as signed.
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Sun Oct 31, 2010 12:01 pm    Post subject:
Reply with quote

hi, if you want to define a signed variable, try this
ws-avariable-1 w 6 n 0 // signed
ws-avariable-2 w 6 n // unsigned

Code:

If you specify a numeric field with decimal positions (0 to 18),
CA-Easytrieve/Plus considers it a signed (quantitative) field.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2435
Location: Netherlands, Amstelveen

PostPosted: Sun Oct 31, 2010 1:31 pm    Post subject:
Reply with quote

quanzhong,

thats what i said. Thanks for emphasizing my post.
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 -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm


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