View previous topic :: View next topic |
Author |
Message |
vijay Beginner
Joined: 09 May 2003 Posts: 131 Topics: 64
|
Posted: Sun May 25, 2003 8:19 am Post subject: Lower Case to Upper CAse |
|
|
Please help me with converting a record from lower case to upper case.Any functions in COBOL-II or EZT or any other utilities is OK.
Thanks,
Vijay |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
vijay Beginner
Joined: 09 May 2003 Posts: 131 Topics: 64
|
Posted: Mon May 26, 2003 2:03 pm Post subject: |
|
|
Thanks for the reply.I used EZT to do this
S1 = 1
DO WHILE S1 LE 300
IF WS-OUTREC-B(S1) GE 129 +
AND WS-OUTREC-B(S1) LE 169
WS-OUTREC-B(S1) = WS-OUTREC-B(S1) + 64
END-IF
S1 = S1 + 1
END-DO |
|
Back to top |
|
|
petluri Beginner
Joined: 05 Dec 2002 Posts: 19 Topics: 5 Location: Virginia, USA
|
Posted: Wed Sep 10, 2003 2:38 pm Post subject: |
|
|
I think in COBOL we have something like FUNCTION UPPER-CASE(input). |
|
Back to top |
|
|
krk123 Beginner
Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Wed Sep 10, 2003 2:47 pm Post subject: |
|
|
Hi Vijay,
If you are trying to convert in the program, you can do something like this.
INSPECT (Your record here )
CONVERTING
'abcdefghijklmnopqrstuvwxyz' TO
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
regards,
KRK123 |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Tue Sep 16, 2003 7:47 am Post subject: |
|
|
vijay said:
Quote: |
Thanks for the reply.I used EZT to do this
S1 = 1
DO WHILE S1 LE 300
IF WS-OUTREC-B(S1) GE 129 +
AND WS-OUTREC-B(S1) LE 169
WS-OUTREC-B(S1) = WS-OUTREC-B(S1) + 64
END-IF
S1 = S1 + 1
END-DO
|
This code is not entirely correct. In addition to converting lower case a-z to upper case A-Z, it will also alter the values of characters with hex values 8A-90 and 9A-A1. Although some of these characters are not valid display characters, some of them are. For example, the '~' or tilde character has hex value A1 and will be altered by this code to hex value E1 which is non-display.
It may be that you data can't contain the values 8A-90 or 9A-A1 but can you guarantee this for all data now and in the future?
Also, your upper limit for the loop should be 255, not 300. |
|
Back to top |
|
|
|
|