I am having requirement to check whether Alphanumric variable is having numeric value(just numbers) in it. Ex- VAR 1 defined as X(4). It can have value as '1234' OR '12ds' i need to process based on whether it is having number values or alphanum values. Can anyone help on this?
Use reference modification (or an array) to check each byte to be spaces or zero through nine (an 88-level might be useful here). If any byte is not one of those 11 eleven characters, it is not numeric. If all bytes are spaces / 0 through 9, then you can use the FUNCTION NUMVAL to convert the PIC X(4) variable to a PIC 9(04) variable and the '12' would be converted as part of that process.