View previous topic :: View next topic
|
Author |
Message |
sree reddy
New User
Joined: 20 Jul 2007 Posts: 27 Location: bangalore
|
|
|
|
i have a field on screen x(08) (99.99999)
the user will be entering on the screen in this format 99.99999
For example he may enter as 1.111 or 0.111
i refined ws- x pic x(08) to ws-y pic 9(2)V9(05)
So if i enter 1.1212 on the screen the value in ws-y will be 0011212
the value in ws-y should not be greater than 99.99999 or = 00.00000
so i am reformating as
05 WS-7-FLD PIC 99.9(5).
05 WS-7-BYTE-REFORMAT REDEFINES WS-7-FLD.
10 WS-7-BYTE-LEFT PIC 9(2).
10 WS-7-BYTE-DECIMAL PIC X(1).
10 WS-7-BYTE-RIGHT PIC 99999.
05 WS-7-BYTE-DISPLAY REDEFINES WS-7-BYTE-REFORMAT
PIC X(8).
so when i move as below
I am moving ws-y to ws-7-fld
The value in Ws-7-fld is 00.11212 actually should be 01.1212
Can anyone please suggest me the solution please
Thanks |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
you've lost me..
do some research on PICIN / PICOUT of BMS basic mapping support.
That might help you out. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
In addition to Earl's suggestion, consider using the NUMVAL intrinsic function. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Just a caution. . .
NUMVAL works great if the input is known to be valid. When users enter data on a screen, the data is known to be questionable. . .
If invalid data is processed by NUMVAL an abend results. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Thanks Dick. I should have mentioned that most, if not all, of the intrinsic functions do not validate the input. |
|
Back to top |
|
|
|