View previous topic :: View next topic
|
Author |
Message |
dharmaraok
New User
Joined: 10 Mar 2011 Posts: 45 Location: india
|
|
|
|
Iam having a numeric field "23.456" or "238.768" and have to read the data from right to left.
While reading the numeric field the fourth byte should always contain "." . if the "." is not present in the fourth byte we need to display an error message.
Could you please let me know what is the approach to complete this requirement.
Thanks for the help. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
01 a-nice-name..
05 name-for-first-part-of-number PIC X(3).
05 FILLER PIC X.
88 field-has-decimal-point VALUE ".".
05 name-for-second-part-of-number PIC X(3).
IF field-has-decimal-point
AND name-for-first-part-of-number NUMERIC
AND name-for-second-part-of-number NUMERIC
do your stuff
END-IF |
|
|
Back to top |
|
|
dharmaraok
New User
Joined: 10 Mar 2011 Posts: 45 Location: india
|
|
|
|
Thanks Bill,
how can we check for S9(2)V999 Comp-3 field. The above logic will applies. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
No. There is nothing to check for a COMP-3/PACKED-DECIMAL field, as you cant have an explicit decimal-point (.) there, only an implicit one (V). |
|
Back to top |
|
|
|