IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Rexx STRIP Equivalent function in CLIST


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

Active User


Joined: 28 Sep 2017
Posts: 106
Location: India

PostPosted: Mon Mar 16, 2020 9:57 pm
Reply with quote

Hi All,

Am writing a CLIST to execute a command.

My CLIST Starts as below

Code:

PROC 1 DSN


But DSN = 'TEST.FILE'

As per the CLIST , I want DSN = TEST.FILE (Without quotes)

Do we have any Rexx STRIP equivalent function in CLIST?
or Any other suggestions to remove quotes in CLIST?

Thanks!
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 385
Location: Bamberg, Germany

PostPosted: Mon Mar 16, 2020 10:36 pm
Reply with quote

You can use &SYSINDEX, &SUBSTR and &LENGTH built-in functions to test for occurance of quotes and copy what's needed. See CLIST built-in functions
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 696
Location: Whitby, ON, Canada

PostPosted: Tue Mar 17, 2020 6:11 am
Reply with quote

Or convert it to Rexx. That is my preferred solution except in rare cases.
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 106
Location: India

PostPosted: Tue Mar 17, 2020 11:40 am
Reply with quote

Hi Joerg,

Thank you for your suggestions. Its working fine now.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 385
Location: Bamberg, Germany

PostPosted: Tue Mar 17, 2020 12:18 pm
Reply with quote

@upendrasri: Mind sharing your code snippet? Would be helpful for others as well. icon_wink.gif
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 106
Location: India

PostPosted: Tue Mar 17, 2020 3:04 pm
Reply with quote

Hi Joerg,

I have used the below code

Code:

SET DSN = 'TEST.UPEN.FILE'
SET A = &LENGTH(&DSN)
SET B = &A - 1
SET C = &SUBSTR(2:&B,&DSN)


OUTPUT as below :
Code:

TEST.UPEN.FILE
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

 


Similar Topics
Topic Forum Replies
No new posts Any examples of calling FTP from REXX? CLIST & REXX 1
No new posts SummeRx: a new framework for REXX z/OS CLIST & REXX 6
No new posts A command to change LRECL of an exist... JCL & VSAM 7
No new posts Using REXX to access SDSF; What am I ... CLIST & REXX 38
No new posts Calling Assembler from REXX PL/I & Assembler 5
Search our Forums:

Back to Top