Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Translating Quotes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 40
Location: India

PostPosted: Tue May 09, 2017 11:52 am    Post subject: Translating Quotes
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: 1018
Location: Oostende, Belgium

PostPosted: Tue May 09, 2017 12:49 pm    Post subject:
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: 40
Location: India

PostPosted: Tue May 09, 2017 12:57 pm    Post subject:
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: 1018
Location: Oostende, Belgium

PostPosted: Tue May 09, 2017 2:34 pm    Post subject:
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: 1788
Location: UK

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

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

Senior Member


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

PostPosted: Tue May 09, 2017 11:23 pm    Post subject: Reply to: Translating Quotes
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: 40
Location: India

PostPosted: Tue May 16, 2017 10:28 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts To change double quotes into csv read... Robert Sample COBOL Programming 3 Fri Feb 19, 2016 8:13 am
This topic is locked: you cannot edit posts or make replies. Put quotes in Symbolic parameter whil... Yashashri All Other Mainframe Topics 7 Mon Feb 15, 2016 12:24 pm
No new posts REXX EDIT MACRO unable to handle doub... anjali.bisht TSO/ISPF 10 Thu Mar 12, 2015 4:55 pm
No new posts How to delimit data with '|' which ha... gch77 DFSORT/ICETOOL 5 Wed Aug 13, 2014 9:16 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us