View previous topic :: View next topic
|
Author |
Message |
sbachina
New User
Joined: 16 Jun 2006 Posts: 4
|
|
|
|
Move Function Upper-case (Item-1) to Item-2 - compilation problem |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
need a tiny bit more detail of your problem please!!!! |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
sbachina,
Can you please explain the error in detail. Morethan that can you please mention what type of compiler you r using. Hope that may not support the fuction it seems. Even i got the error in the line
Code: |
DISPLAY FUNCTION UPPER-CASE(STR1). |
Quote: |
10 DISPLAY "ENTER A STRING :".
11 ACCEPT STR1.
12 DISPLAY FUNCTION UPPER-CASE(STR1).
R089E line= 12 col= 20 "FUNCTION"
R089E line= 12 col= 29 "UPPER-CASE"
13 STOP RUN.
14
SOFTEK COBOL V1.003 SOURCE: UPRCASE.CBL DATE 16 Jun :6 TIME 09:43:55
PAGE: 00002
End of Compilation
2 Errors
0 Warnings
14 Source Lines
4 Symbols |
Hope it varies with compilers.
If you place the error or query in detail it may help our members to solve it. |
|
Back to top |
|
|
sbachina
New User
Joined: 16 Jun 2006 Posts: 4
|
|
|
|
Hi khamarutheen,
The following errors are I am getting during the compilation of the program. The type of compiler is CICS COBOL-11 with IMS. I am using IBM COBOL.
IGYPS2121-S "FUNCTION" was not defined as a data-name. The statement was discarded.
IGYPS0088-S The "MOVE" statement was invalid. Expected "TO", but found "UPPER-CASE". The statement was discarded. |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
Are you trying to convert Item-1 from lower to upper case, giving the result in Item-2?
if so then
INSPECT Item-1
CONVERTING
”abcdefghijklmnopqrstuvwxyz “TO
”ABCDEFGHIJKLMNOPQRSTUVWXYZ “
MOVE Item-1 to Item-2
will do the trick. |
|
Back to top |
|
|
sbachina
New User
Joined: 16 Jun 2006 Posts: 4
|
|
|
|
Hi IQofaGerbil,
Item-1 is 1 char value but I don't what value in item-1. (Any character will be expected either A-Z OR a-z).
INSPECT Item-1
CONVERTING Variable-1 TO Variable-2
MOVE Item-1 to Item-2 |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
my code will convert ANY lower case character to its upper case equivalent
if any other character is found it will be left as is.
Is that not what you want? |
|
Back to top |
|
|
sbachina
New User
Joined: 16 Jun 2006 Posts: 4
|
|
|
|
Thank you IQofaGerbil,
Yes, It worked. |
|
Back to top |
|
|
|