Page 1 of 1

how to read a dataset with ampersands

PostPosted: Tue Sep 28, 2010 8:06 am
by educ99
I have a problem. I have to read a dataset that contains many ampersands in its records.
I have to do that using a CLIST.
When CLIST finds a ampersand, occurs a error because CLIST thinks that the ampersand is a variable.

How can I read these records?
Is there a way to change the first character of a variable (the ampersand) within a CLIST?

Excuse-me by my English, my native idiom is Portuguese from Brazil.

Re: how to read a dataset with ampersands

PostPosted: Tue Sep 28, 2010 8:14 am
by dick scherrer
Hello and welcome to the forum,

Please do not post the same question in multiple parts of the forum - the duplicate has been deleted.

Excuse-me by my English, my native idiom is Portuguese from Brazil.
Not to worry - many here do not have English as their first language :)

Is CLIST only to be used or might this be done with REXX?

Is this an existing CLIST or new code for this requirement.

How is the data being read?

Re: how to read a dataset with ampersands

PostPosted: Tue Sep 28, 2010 8:25 am
by educ99
Thanks.
I've posted twice because I haven't seen this more appropriate topic.
I have to use CLIST because I don't know REXX.
I'm doing a new code.
I'm reading PDS JCL members, finding some string and changing it.
The CLIST works very well, but when it find a ampersand, it fails.

Re: how to read a dataset with ampersands

PostPosted: Tue Sep 28, 2010 10:07 am
by NicC
What fails? The CList or the edit of the member? What is the error message?

Re: how to read a dataset with ampersands

PostPosted: Tue Sep 28, 2010 10:21 pm
by educ99
The CLIST fails.
Ex:
LINE in the member:
//SYSUT1 DD DSN=&&TEMP

CLIST:
SET VAR1=&STR(&SUBSTR(17:21,&STR(&LINE))

The value of the SUBSTR = &&TEMP

The CLIST expect a variable named &TEMP, then it fails.

Re: how to read a dataset with ampersands

PostPosted: Wed Sep 29, 2010 1:05 am
by NicC
I haven't used CLIST in about 20 years so I do not know how you can check for && in var1. But if you can then just substr from position 2. Or learn Rexx :-)