how to use qutotaions in listds commands?



IBM's Command List programming language & Restructured Extended Executor

how to use qutotaions in listds commands?

Postby SKANDA » Wed Jan 18, 2017 4:01 pm

Hi All,

please guide me to use appropriate quotes in below syntax,

dataset_name = " ' " xyz.abc.opl " ' "
file = dataset_name
x = outtrap(dc.)
"listds (" ' file ' " )members"
x = outtrap(off)

I have tried to get the members of the dataset by using the above code,but due to improper qutotaions I dint get the output.
kindly help me out.

Thanks,
Skanda
SKANDA
 
Posts: 30
Joined: Thu Aug 04, 2016 7:50 pm
Has thanked: 17 times
Been thanked: 0 time

Re: how to use qutotaions in listds commands?

Postby NicC » Wed Jan 18, 2017 4:52 pm

When you:
SAY dataset_name and file
what do you get
What do you get when you put a trace on?
Why move 'dataset_name' to 'file'?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: how to use qutotaions in listds commands?

Postby SKANDA » Wed Jan 18, 2017 6:58 pm

hi,

(I) When I used the datasaet_name and file with the quotations mentioned, members of the dataset is not listed in the stem variable.
so I couldn't process further.(I guess that there might be mistake in the quotation that's why the member of the mentioned dataset is not listed)
(ii)For display purpose I have moved dataset name to file.

Thanks,
Skanda
SKANDA
 
Posts: 30
Joined: Thu Aug 04, 2016 7:50 pm
Has thanked: 17 times
Been thanked: 0 time

Re: how to use qutotaions in listds commands?

Postby Pedro » Wed Jan 18, 2017 10:45 pm

You did not really answer any of Nicc's questions. I do not believe he was asking for descriptive answers, but to show us exactly what you see in the trace.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: how to use qutotaions in listds commands?

Postby Pedro » Wed Jan 18, 2017 10:51 pm

There are probably other errors, but this comes to mind:
"listds (" ' file ' " )members"

You should know that both the double-quote and the single quote are delimiters for constants. In this line, you have three constants, the same as this:
"constant1"   'constant2'  "constant3"

It will not try to resolve the variables like you expect because no variables are shown here; they are all quoted strings.
Pedro Vera

These users thanked the author Pedro for the post:
SKANDA (Mon Jan 23, 2017 12:31 pm)
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: how to use qutotaions in listds commands?

Postby NicC » Wed Jan 18, 2017 10:56 pm

Exactly, Pedro.
Skanda, both dataset_name and file will have their contents displayed nicely using SAY as one is a simple copy of the other. All data in Rexx is text. If that text is numeric then rexx can do maths with it.

You can probably do this:
dataset_name = " ' " xyz.abc.opl " ' "
Say dataset_name
x = outtrap(dc.)
"listds ("dataset_name" )members"
x = outtrap(off)

You can also add thge following line before the assignment to dataset_name
trace ?r

and the following after the Say
trace o
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
SKANDA (Mon Jan 23, 2017 12:22 pm)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: how to use qutotaions in listds commands?

Postby Pedro » Wed Jan 18, 2017 11:47 pm

When you edit rexx programs using the ISPF editor, issue the 'HI ON' command. Context sensitive highlighting will be turned on. It will be readily apparent when you type a constant vs. when you time a variable.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: how to use qutotaions in listds commands?

Postby willy jensen » Thu Jan 19, 2017 10:19 pm

assuming that the datasetname is xyz.abc.opl then this is how to do it:
]
dataset_name = "'xyz.abc.opl'"
file = dataset_name
x = outtrap(dc.)
"listds" file "members"
x = outtrap(off)
 

Note that you cannot have blanks between the apostrophes, so if xyz.abc.opl is a stem variable containing the datasetname then the first assignment must be like this:
dataset_name = "'"xyz.abc.opl"'"
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: how to use qutotaions in listds commands?

Postby SKANDA » Mon Jan 23, 2017 12:31 pm

Hi all,

Thank you all for your great response.
I got the thing which I want.
Thank you NicC by using "Trace" option only I can find the mistake where I went wrong..

Many Thanks,
Skanda
SKANDA
 
Posts: 30
Joined: Thu Aug 04, 2016 7:50 pm
Has thanked: 17 times
Been thanked: 0 time

Re: how to use qutotaions in listds commands?

Postby NicC » Mon Jan 23, 2017 2:54 pm

You should always, ALWAYS, ALWAYS use Trace before you post a query.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
SKANDA (Tue Jan 24, 2017 4:53 pm)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post