Is there any condition in cobol to check the variable has any special characters?

Showing Answers 1 - 10 of 10 Answers

RAJA

  • Aug 23rd, 2006
 

If it is numeric we can check whether the field in NUMERIC else if it is character

we can check whether it is ALPHANUMERIC

  Was this answer useful?  Yes

sangramkc

  • Jan 10th, 2007
 

Hi,In COBOL there are only two clouse for this type of check IS NUMERIC & IS ALPHABETIC let's take examplee.g A PIC X(01) VALUE '$'We can check following procedure divisionIF A IS NUMERIC DISPLAY 'NUMERIC' ELSE IF A IS ALPHABETIC DISPLAY 'ALPHABETIC' ELSE DISPLAY 'ALPHANUMERIC' END-IF END-IF It will display Alphanumeric as $ is not a alphabetic character (A to Z)
Thanks
Sangram
Jai sai ram

Pranab

  • Sep 13th, 2014
 

Through "Inspect" verb its possible. like, if you want to search $ in var1 than - INSPECT VAR1 TELLING TELLY1 ALL $ DELIMITED BY SIZE.

if TELLY is >0 then it is having the special character $.

  Was this answer useful?  Yes

Chander

  • Sep 22nd, 2015
 

Hi, I guess the Hex range can be checked, HEX 50-60 is special chars.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions