View previous topic :: View next topic
|
Author |
Message |
rashmirgowda
New User
Joined: 18 Jun 2008 Posts: 25 Location: india
|
|
|
|
Hi,
Please let me know how to check the numeric value in alphanumeric field.
I am having the Alphanumeric field A X(10) in map. i want to check the value is numeric or not. The Field A is a table variable.
i have tried and entered the value as 100.
if A(ws-sub) is numeric
true
else
false
end-if.
But the value 100 is not going in to true condition. Please guide anyone to resolve this. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Look/search for NUMVAL (or NUMVAL-C) Cobol Function. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
But the value 100 is not going in to true condition. Please guide anyone to resolve this |
though 100 maybe numeric,
if it is contained in a x(10) field, there are 7 spaces also included,
which are not numeric.
Although the NUMVAL suggestion is ok,
problem with NUMVAL is that it will cause an exception if there are unexceptable values in the field. - read the manual.
Suggest you look at BIFEDIT, in the CICS manuals. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
I'm sorry, I did not realize that we were in CICS part of the Forum. CICS is not yet my cup-of-tea....
Thanks Dick. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
CICS is not yet my cup-of-tea |
nor mine, but I have read enough of Bill's posts to know about BIFEDIT,
and
I have encountered enough problems with NUMVAL - you need to pre-check the values. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Maybe a change is needed to the BMS "DFHMDF" macro associated with this map-field?
Review operand ATTRB=NUM, which can be used together with operand's PICIN and PICOUT. You may not need PICOUT, but that's up to you.
When PICIN and/or PICOUT are used together with NUM, the generated map-fields are PIC 9 as opposed to PIC X (without PICIN/PICOUT) and the map-data will be received as numeric, right-justified with high-order zeros.
In your case, when the user enters 100 in positions 1-3 of the map-field, it resolves as 0000000100 after the receive.
Google "DFHMDF" and you'll get many hits....
Bill |
|
Back to top |
|
|
|