Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Rexx STRIP Equivalent function in CLIST

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Rexx STRIP Equivalent function in CLIST
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: 342
Location: Bamberg, Germany

PostPosted: Mon Mar 16, 2020 10:36 pm    Post subject:
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: 692
Location: Whitby, ON, Canada

PostPosted: Tue Mar 17, 2020 6:11 am    Post subject:
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    Post subject:
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: 342
Location: Bamberg, Germany

PostPosted: Tue Mar 17, 2020 12:18 pm    Post subject:
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    Post subject:
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    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 REXX script to beautify XML jzhardy CLIST & REXX 1 Sun Oct 11, 2020 1:23 pm
No new posts TWS PIF (EQQYCOM) Rexx - Occurrence S... Richard Baker IBM Tools 0 Wed Sep 16, 2020 10:45 am
No new posts DB2 - row_number function - Need 1st ... Q5P418 DB2 5 Wed Sep 09, 2020 8:35 am
No new posts Call Natural program with rexx shahaf CLIST & REXX 2 Tue Sep 08, 2020 11:22 am
No new posts CA Sysview - JCL or Rexx - Read or Ex... Jasi CA Products 4 Wed Aug 05, 2020 9:19 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us