Page 1 of 1

pl/i - conversion from character to numeric

PostPosted: Wed Nov 12, 2008 10:01 pm
by marilyngo
I work in a VM/ESA environment, with PL/I code.
I need to determine if a character in a string is a control character. In other words, if the ascii value of any character in a string is <32 or >126, consider it invalid.
Is there anything comparable to a builtin ascii function that does this conversion, like some languages will have an ASC() or ASCII() function?

Thank you in advance for any help

Re: pl/i - conversion from character to numeric

PostPosted: Thu Nov 13, 2008 1:01 am
by dick scherrer
Hello and welcome to the forum,

What you describe is 7-bit ascii and i know of nothing on an ibm mainframe that uses 7-bit ascii. Actually, all of the windows and unix things i work with use 8-bit ascii also. . .

What are you dealing with that still uses 7-bit ascii?

To do what you want, you could check for characters that are < x'20' or > x'7F'. That shouldn't require any special function.