Date: Mon, 25 Jun 2001 10:14:17 -0400
Reply-To: Richard DeVenezia <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Richard DeVenezia <radevenz@IX.NETCOM.COM>
Organization: MindSpring Enterprises
Subject: Re: SCL/SHARE
If you are updating the table strictly through SCL, SAS/Share should take of
By default open() should be opening a shared table with record level
You get a lock on a row (unless something else has a lock on the same row)
when you do a fetch() or fetchobs().
A row would be prepared for update by changing values in the Table Data
Vector (TDV) using putvarc() or putvarn().
The changes would be commited using update().
If someone wants to open&update a table against which a proc is concurrently
running they probably won't be able to since the Proc most likely has a
table lock. If someone has a table opened, a proc will fail if it wants a
table lock. In both cases you must come up with a 'notify user while
waiting for required lock' scheme that utilizes the return codes from the
functions and &SYSERR assigned by procs.
There are also AF components such as Data Set Data Vector and Data Set Data
Model for performing the equivalent of the above SCL functions.
If a row is locked, no submitted code (or SCL code or SQL code) would be
able to 'rewrite' the table.
Proc SQL can update non-locked rows of an other opened table if you use the
If you are having trouble where you expect none, look into system settings
of CNTLLEV and possibly using the data set open CNTLLEV in your open()
Richard DeVenezia - SAS Macros and AF Tools
"Graeme Kirton" <gkirton@FILCS.COM> wrote in message
> Meredith gave me an understanding for grabing records using SCL.
> Using SAS/Share Im trying to write to a dataset several times, where a
> will have 'R' access.
> Any ideas on how I can do simultaneous writing 'updating' a dataset using
> If a 'W' appears by a username the subsequent table would be locked, until
> was freed on exit.
> ---------------------- Forwarded by Graeme Kirton/Filcs on 25/06/2001
> Meredith Clark <firstname.lastname@example.org> on 22/06/2001 15:56:20
> To: Graeme Kirton/Filcs@Filcs.com, SAS-L@LISTSERV.UGA.EDU
> Subject: Re: SCL
> dsid=open('dataset.name'); /*create a dataset id */
> /*create scl variables out of the variables in the
> 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*/
> if level='W' then do;
> submit continue;
> proc whatever;
> 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
> This email may contain privileged/confidential information and/or
> 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
> by mistake, please advise the sender immediately by using the reply
> your email software and delete the material from your computer.
> Opinions, conclusions and other information in this email that do not
> the official business of this organisation shall be understood as neither
> nor endorsed by it.
> If this message forms part of a quotation, the quotation is an invitation
> treat only. No contract subsists until Filtronic Plc (or its subsidiary
> companies) accepts your order. Acceptance of your order is made subject
> standard Terms and Conditions.
> Website Address http://www.filtronic.com