Date: Mon, 25 Jun 2001 16:18:56 +0200
Reply-To: Yung-Yang_Hu@ABNAMRO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Yung-Yang_Hu@ABNAMRO.COM
Subject: Re: SCL/SHARE
Content-type: text/plain; charset=us-ascii
To everyone who uses SAS/SHARE with SCL: It is very important to check
the returncodes!
IF you use rc=FETCH() of rc=FETCHOBS() it is important to check these
before you use getvar() or putvar().
These returncodes indicate if you have access to update the record. e.g. If
rc=-650054 then you cannot update the record
To lock an entire dataset or library for e.g. sorting you can use the LOCK
() function in SCL.
(for the returncodes you can check SAS/SCL reference V6 pp 193-199)
It is not easy to make an application with SAS/SHARE foolproof! MAny
returncodes have to be checked and handled. Otherwise lots of program
halted's is the result
HTH
Yung-Yang Hu
Pecoma Informatica
"Meredith Clark" <clarkmeredith@YAHOO.COM>@LISTSERV.UGA.EDU> on 06/25/2001
02:46:54 PM
Please respond to "Meredith Clark" <clarkmeredith@YAHOO.COM>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
To: SAS-L@LISTSERV.UGA.EDU
cc:
Subject: Re: SCL/SHARE
workdsid=open('WORK.SEGMETAD(where=(segcode='||quote(segm)||'))','U'
workdsid=open('work.datast(where=(var1='||quote(value)||')),'U');
/*assigns data set ID to SAS data set applying a
where clause*/
currow=; /*initializes current row indicator*/
rc=fetchobs(workdsid,currow); /*fetches the
observation*/
call putvar(workdsid,4,var1); /*writes the value of
the numeric variable 'var1' to the fourth variable in
the data set ID*/
call putvarc(workdsid,10,var2); /*writes the value of
the character variable 'var2' to the tenth variable*/
rc=update(workdsid); /*applies the update*/
workdsid=close(workdsid); /*closes the data set*/
--- Graeme Kirton <gkirton@FILCS.COM> wrote:
> Meredith gave me an understanding for grabing
> records using SCL.
>
> Using SAS/Share Im trying to write to a dataset
> several times, where a username
> will have 'R' access.
>
> Any ideas on how I can do simultaneous writing
> 'updating' a dataset using SCL?
>
> If a 'W' appears by a username the subsequent table
> would be locked, until it
> was freed on exit.
>
> ThanxAgain
>
> ---------------------- Forwarded by Graeme
> Kirton/Filcs on 25/06/2001 11:18
> ---------------------------
>
>
> Meredith Clark <clarkmeredith@yahoo.com> on
> 22/06/2001 15:56:20
>
> To: Graeme Kirton/Filcs@Filcs.com,
> SAS-L@LISTSERV.UGA.EDU
> cc:
>
> Subject: Re: SCL
>
>
>
>
> rdfile:
> dsid=open('dataset.name'); /*create a dataset id */
> /*create scl variables out of the variables in the
> file*/
> obs=attrn(dsid,'nlobs);/*number of non-deleted
> observations in data set*/
> do i=1 to obs; /*assign scl variable to all
> records*/
> rc=fetchobs(dsid,i);/*fetched records*/
> dataset=getvarc(dsid,varnum(priordsid,'dataset'));
> username=getvarc(dsid,varnum(priordsid,'username'));
> level=getvarc(dsid,varnum(priordsid,'level'));
>
> if level='W' then do;
> submit continue;
> proc whatever;
> run;
> endsubmit;
> end; /*find variable number assigned to specified
> variable and assign the value to the new scl
> variable
> called the same name*/
>
>
>
>
>
>
>
>
> --- Graeme Kirton <gkirton@FILCS.COM> wrote:
> > Hi people,
> >
> > I have a problem, Im starting to write some SCL so
> > that I have a dataset called
> > 'locking' and this file has only three variables,
> > dataset-username-level. I
> > need to know how to write to the dataset and
> > readfrom the dataset using SCL.
> >
> > Users have a level 'R' =read 'W'=write, a specific
> > table and can have many user
> > entrys;
> >
> > lookup-gkirton-R
> > lookup-jbloggs-R
> > passfail-sasuser-W
> >
> > But if a W is detected the passfail dataset is
> > locked and users will have to
> > wait 'pause' until it becomes free.
> >
> > The SCL part will be round some rsubmit blocks to
> > perform other manipulation on
> > datasets, but I want to be able to control access.
> > Any Ideas much
> > appreciated???
> >
> > Thanks and Regards
> >
> > Graeme
> >
> >
> >
> >
>
____________________________________________________________________________________________________________
>
> >
> > Disclaimer
> >
> > This email may contain privileged/confidential
> > information and/or copyright
> > material. It is intended only for the use of the
> > person(s) to whom it is
> > addressed and any unauthorised use may be
> unlawful.
> > If you receive this email
> > by mistake, please advise the sender immediately
> by
> > using the reply facility on
> > your email software and delete the material from
> > your computer.
> >
> > Opinions, conclusions and other information in
> this
> > email that do not relate to
> > the official business of this organisation shall
> be
> > understood as neither given
> > nor endorsed by it.
> >
> > If this message forms part of a quotation, the
> > quotation is an invitation to
> > treat only. No contract subsists until Filtronic
> > Plc (or its subsidiary
> > companies) accepts your order. Acceptance of your
> > order is made subject to our
> > standard Terms and Conditions.
> >
> > Website Address http://www.filtronic.com
>
>
> =====
> Meredith Clark
> Systems Engineer
> Harte-Hanks CRM
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
>
>
____________________________________________________________________________________________________________
>
> Disclaimer
>
> This email may contain privileged/confidential
> information and/or copyright
> material. It is intended only for the use of the
> person(s) to whom it is
> addressed and any unauthorised use may be unlawful.
> If you receive this email
> by mistake, please advise the sender immediately by
> using the reply facility on
> your email software and delete the material from
> your computer.
>
> Opinions, conclusions and other information in this
> email that do not relate to
> the official business of this organisation shall be
> understood as neither given
> nor endorsed by it.
>
> If this message forms part of a quotation, the
> quotation is an invitation to
> treat only. No contract subsists until Filtronic
> Plc (or its subsidiary
> companies) accepts your order. Acceptance of your
> order is made subject to our
> standard Terms and Conditions.
>
> Website Address http://www.filtronic.com
=====
Meredith Clark
Systems Engineer
Harte-Hanks CRM
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/