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

picture reformat decimals


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sree reddy

New User


Joined: 20 Jul 2007
Posts: 27
Location: bangalore

PostPosted: Thu Sep 24, 2009 9:00 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Sep 25, 2009 2:46 am
Reply with quote

you've lost me..

do some research on PICIN / PICOUT of BMS basic mapping support.

That might help you out.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Sep 25, 2009 2:57 am
Reply with quote

In addition to Earl's suggestion, consider using the NUMVAL intrinsic function.
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: Fri Sep 25, 2009 3:19 am
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Sep 25, 2009 3:23 am
Reply with quote

Thanks Dick. I should have mentioned that most, if not all, of the intrinsic functions do not validate the input.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
No new posts Reformat and relocate content DFSORT/ICETOOL 4
This topic is locked: you cannot edit posts or make replies. Assembler - Packed Decimals - PACK in... PL/I & Assembler 3
No new posts Reformat for VB file SYNCSORT 11
No new posts Need help on the multiple files refor... DFSORT/ICETOOL 7
Search our Forums:

Back to Top