pl/i - conversion from character to numeric

IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

pl/i - conversion from character to numeric

Postby marilyngo » Wed Nov 12, 2008 10:01 pm

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
Posts: 1
Joined: Wed Nov 12, 2008 9:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: pl/i - conversion from character to numeric

Postby dick scherrer » Thu Nov 13, 2008 1:01 am

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.
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Return to PL/I


  • Related topics
    Last post