Have a need to convert terminal input from lower to upper case, but<br>
it must be accomplished with COBOL language; no calls to Assembler<br>
are acceptable to the site.
Should have specified that. Yes, I'm converting<br>
a CICS macro level assembler program to a CICS<br>
COBOL OS/390 program. I could use an Assembler<br>
CALL subroutine to do the job, but my clients<br>
would rather COBOL be used. Thanks.
Not very elegant but one option is to use the INSPECT statement. I have not used it but the syntax would be something like:<br>
<br>
INSPECT WS-FIELD REPLACING ALL "a" BY "A"<br>
<br>
I guess you would have to repeat the statement 26 times. Maybe you can create a table of conversion characters and have a routine that spins through it...<br>
Good idea! In fact, I just came across a new<br>
implementation for INSPECT on COBOL II , release 3<br>
and later:<br>
INSPECT WS-FIELD <br>
CONVERTING 'abcd...' TO 'ABCD...'<br>
I'll try and let you know what happened. <br>
Thanks.
The INSPECT worked like a champ.<br>
I used <br>
INSPECT WS-FIELD<br>
CONVERTING 'abcdefghijklmnopqrstuvwxyz'<br>
TO 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'<br>
and the reverse (to convert upper to lower case).<br>
The reverse also worked.<br>
It doesn't care how many times a letter appears.<br>
It converts every one. Also, it won't bother a<br>
letter if it's already "converted."<br>
Thanks again. <br>
<br>
<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.