Date: Thu, 16 Apr 1998 07:16:00 -0700
Reply-To: KWIERINC@RAYCHEM.COM
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Wierinck Kurt <KWIERINC@RAYCHEM.COM>
Subject: Re: SCL Problem
Content-Type: text/plain; charset=US-ASCII
Try this , Rob.
i = 1; found = 0;sea_user = 'USER5';
do while ((i LE LISTLEN(userlist)) AND (found NE 1)) ;
l_user = GETITEMl(userlist,i);
user = getnitemc(l_user,'USER');
if (user EQ sea_user) then found = 1;
i = i +1;
end;
if (found) THEN _MSG_ = 'User '||sea_user||' found !!!';
else _MSG_ = 'User '||sea_user||' not found !!!';
To use these lines of code the statement in your code:
userlist = insertn(userlist,obs,-1);
should be
userlist = insertl(userlist,obs,-1);
Greetings,
Kurt Wierinck
E-Mail : kurt.wierinck@be.origin-it.com
______________________________ Reply Separator _________________________________
Subject: SCL Problem
Author: steskey@interlog.com at internet
Date: 4/15/98 5:08 PM
Hi.
I hope someone can help with this. I have the following SCL:
******************************************************************;
templist=makelist();
userlist=makelist();
rc=fillist('CATALOG','AFLIB.DATALIB.USERS.SOURCE',templist,0);
do i = 1 to listlen(templist);
obs=makelist();
do x = i to i;
rc=insertc(obs,substr(getitemc(templist,x),2,8), -1, 'USER');
rc=insertc(obs,substr(getitemc(templist,x),11,8), -1, 'PSWD');
rc=insertc(obs,substr(getitemc(templist,x),21,1), -1, 'ACCS');
rc=insertc(obs,substr(getitemc(templist,x),23,8), -1, 'MOD');
end;
userlist = insertn(userlist,obs,-1);
end;
******************************************************************;
Now some explanation. This is a nested SCL list. The list looks as
follows:
[userlist
[obs USER1
PSWD1
ACCS2
MOD1
] {end of first user info}
[obs USER2
PSWD2
ACCS2
MOD2
] {end of second user info}
[obs USER3
PSWD3
ACCS3
MOD3
] {end of third user info}
] {end of user list}
Question: How do I search my list to see if a userid exists in the
userlist (if USER5 is in the userlist)?
Any help is greatly appreciated. Thanks in advance.
Rob.