Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

from pic x to pic 9 1

Status
Not open for further replies.

claudeb

Programmer
Nov 23, 2000
140
CA
hi,
my fiels A is defined as pic X(02).
field B is a pic 9 (07) comp-3.
values of A= me, no, 1m, 01,03,12.
how can i put 01, 03, 12 into B ?
i am looking for some thing that could tell me that i have a number, i guess. i am working whith cobol I.
The real situation is, if i get CHN01 ( a different field that points to field A) , i must put 01 in B, but i don't know in advance what value i will have.
i tried some thing like field (4:2), but the compiler wouldn't accept it.
thanks for any suggestion.

 
Hi Claude,

IF A IS NUMERIC
MOVE A TO B
END-IF

Should work.

Jack
 
hi Salde,
I really happy to know that you are still there. i was thinking about you these 2 days. i have a friend who is in state of shock. are you ok ?
 
Hi Claude,

I'm OK, but we're all in shock.
Thanx for your concern, Jack.
 
To all affected by the terrorist attacks on the US: my deepest sympathy.

Regarding Jack's suggestion: if the compiler doesn't condone a numeric test on a alphanumeric (pic x) field, redefine it, either im- or explicitly:

01 A.
03 B PIC 9(02).

or

01 A PIC X(02).
01 B REDEFINES A
PIC 9(02).

Regards,
Ronald.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top