LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (June 2001, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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

Graeme:

If you are updating the table strictly through SCL, SAS/Share should take of everything. By default open() should be opening a shared table with record level locking. 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 UNDO_POLICY=NONE 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() invocations.

-- Richard DeVenezia - SAS Macros and AF Tools http://www.devenezia.com

"Graeme Kirton" <gkirton@FILCS.COM> wrote in message news:80256A76.00393A49.00@fil-notes01.filcs.com... > 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


Back to: Top of message | Previous page | Main SAS-L page