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: 121
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

Senior Member


Joined: 15 Aug 2015
Posts: 1255
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: 765
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: 121
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

Senior Member


Joined: 15 Aug 2015
Posts: 1255
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: 121
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top