Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
harry07
Warnings : 1

New User

Joined: 15 Nov 2006
Posts: 7

 Posted: Fri Nov 17, 2006 10:14 pm    Post subject: Suggest Field definition for Negative values Hi Please suggest the field definition for my requirement below. If the field is negative it should be occupy first position in the field & if not positive then the first position should be occupied by zero & not spaces. Suppose if the field is 1 & pic 9(9).9(2) if negative should be displayed as -00000001.00 if positive should be displayed as 000000001.00 Please let me know your inputs on the same.

mmwife

Super Moderator

Joined: 30 May 2003
Posts: 1592

 Posted: Sun Nov 19, 2006 2:12 am    Post subject: Hi Harry, You didn't say what you plan to do after you get what you want. What you defined in your post is a numeric edited field and you can only use it for display purposes, i.e. you can't do math on it. So, how do you plan to use it. An answer (if any) depends on the ans to this ques.
harry07
Warnings : 1

New User

Joined: 15 Nov 2006
Posts: 7

 Posted: Sun Nov 19, 2006 2:27 am    Post subject: Re: Suggest Field definition for Negative values hi I would like it for display purpose only & nothing is required for mathematical calculations.
mmwife

Super Moderator

Joined: 30 May 2003
Posts: 1592

 Posted: Mon Nov 20, 2006 2:24 am    Post subject: Hi Harry, Your PIC s/b be something like pic -9(9).9(2). That will display the minus sign when the value is neg. If it's pos you can do something like this: IF VAR(1:1) = SPACE MOVE ZERO TO VAR(1:1) END-IF Or you can move in a '+' (my choice), but you know your requirements better than me (er.. I). Can't think of anything more elegant.
UmeySan

Active Member

Joined: 22 Aug 2006
Posts: 757
Location: Germany

 Posted: Mon Nov 20, 2006 2:15 pm    Post subject: Re: Suggest Field definition for Negative values Hi ! Why not using a mask like: 01 ZNUM-1206 PIC +++++++++++9,999999. 01 ZNUM-1602 PIC +++++++++++++++9,99. 01 ZNUM-1800 PIC ZZZZZZZZZZZZZZZZZ9. 01 ZNUM-0400 PIC ZZZ9. 01 ZNUM-08BB PIC 999B999B99. Regards, UmeySan
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics attchmvs from rexx subroutine that re... harisukumaran CLIST & REXX 1 Fri Jan 19, 2018 5:29 am Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us