IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Translating Quotes


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Tue May 09, 2017 11:52 am
Reply with quote

Hi,
I am trying below code
Code:

CALL_STMT = "CALL 'MODULE1' USING "
CALL_STMT1 = "CALL "MODULE2" USING "
SAY CALL_STMT
SAY CALL_STMT1

SPACES = " "
DOUBLE_QUOTE = '"'
SINGLE_QUOTE = "'"

TRANSLATE(CALL_STMT,SPACES,SINGLE_QUOTE)
TRANSLATE(CALL_STMT1,SPACES,DOUBLE_QUOTE)
SAY CALL_STMT
SAY CALL_STMT1
 


Expected output is
Code:

CALL MODULE1 USING
CALL MODULE2 USING


I am trying - To read the COBOL program, when there is a call statement in the line, I should take out the single and double quotes which are using to values of literal for cobol static call programs, then called program name will be separated using PARSE VAR CALLDUMMY PGMNAME.

While running above code I am getting below error

Code:

'CALL"MODULE1"USING"' is not recognized as an internal command
'CALL"MODULE2"USING"' is not recognized as an internal command


also when i try to execute below loops but both the loops are not satisfied

Code:


IF POS(SINGLE_QUOTE,CALL_STM1) THEN
   SAY 'LINE HAS SINGLE QUOTE'

IF POS(DOUBLE_QUOTE,CALL_STM1) THEN
   SAY 'LINE HAS DOUBLE QUOTE'

I need the above check - to make sure it is static call - If i dont have any quotes then i will move the line to dynamic call stem[/code]

help me in achieving above
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1226
Location: Vilnius, Lithuania

PostPosted: Tue May 09, 2017 12:49 pm
Reply with quote

How about a RTFM?

translate \= upper
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Tue May 09, 2017 12:57 pm
Reply with quote

Hi,

When I try to hard code values as mentioned above, it not working for ""

Var1 = "CALL "MODULE2" USING"

here it interprets "CALL " ---> as a literal, MODULE2 ---> as variable/string, " USING" --> as literal, which is why pos and translate are not working.

When I try reading the same from a file - this is working - Strange - not sure how.

However, I am going to read cobol module (input) from file only, so am good. Thank you icon_smile.gif
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1226
Location: Vilnius, Lithuania

PostPosted: Tue May 09, 2017 2:34 pm
Reply with quote

Maybe you should go to the Beginners Forum, as you're very obviously way too clueless to be posting on a forum for experts!
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2432
Location: Hampshire, UK

PostPosted: Tue May 09, 2017 4:07 pm
Reply with quote

Read up about quotes.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2206
Location: Silicon Valley

PostPosted: Tue May 09, 2017 11:23 pm
Reply with quote

re:
Quote:
While running above code I am getting below error

'CALL"MODULE1"USING"' is not recognized as an internal command
'CALL"MODULE2"USING"' is not recognized as an internal command


Show us a trace. I get different results than you:
Code:
     11 *-* TRANSLATE(CALL_STMT,SPACES,SINGLE_QUOTE) 
        >>>   "CALL  MODULE1  USING "                 
 INVALID KEYWORD, USING                               
        +++ RC(12) +++                               


Your use of:
Code:
TRANSLATE(CALL_STMT,SPACES,SINGLE_QUOTE)

shows a misunderstanding of TRANSLATE. I think it should be:
Code:
call_stmt = TRANSLATE(CALL_STMT,SPACES,SINGLE_QUOTE)
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Tue May 16, 2017 10:28 am
Reply with quote

Thank you Pedro. I have corrected as above icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Strings with double quotes having pro... All Other Mainframe Topics 11
No new posts To change double quotes into csv read... COBOL Programming 3
This topic is locked: you cannot edit posts or make replies. Put quotes in Symbolic parameter whil... All Other Mainframe Topics 7
No new posts REXX EDIT MACRO unable to handle doub... TSO/ISPF 10
No new posts How to delimit data with '|' which ha... DFSORT/ICETOOL 5

Back to Top