how to read a dataset with ampersands



IBM's Command List programming language & Restructured Extended Executor

how to read a dataset with ampersands

Postby educ99 » Tue Sep 28, 2010 8:06 am

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.
educ99
 
Posts: 3
Joined: Tue Sep 28, 2010 7:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: how to read a dataset with ampersands

Postby dick scherrer » Tue Sep 28, 2010 8:14 am

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?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: how to read a dataset with ampersands

Postby educ99 » Tue Sep 28, 2010 8:25 am

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.
educ99
 
Posts: 3
Joined: Tue Sep 28, 2010 7:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: how to read a dataset with ampersands

Postby NicC » Tue Sep 28, 2010 10:07 am

What fails? The CList or the edit of the member? What is the error message?
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 read a dataset with ampersands

Postby educ99 » Tue Sep 28, 2010 10:21 pm

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.
educ99
 
Posts: 3
Joined: Tue Sep 28, 2010 7:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: how to read a dataset with ampersands

Postby NicC » Wed Sep 29, 2010 1:05 am

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


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post