BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
nbonda
Obsidian | Level 7

I have a  multiple macros those select record conditionally from database tables and insert output records into a sas datasets.

some times these macros run parallel and insert resulting records into a same dataset.

I am using proc sql  to insert records, but I am losing some of the records.

is there other way we can insert processed records into a dataset.

1 ACCEPTED SOLUTION

Accepted Solutions
Peter_C
Rhodochrosite | Level 12

Is SAS/SHARE available

it was designed to support such concurrent update

View solution in original post

4 REPLIES 4
Peter_C
Rhodochrosite | Level 12

Is SAS/SHARE available

it was designed to support such concurrent update

SASKiwi
PROC Star

How long do your inserts take? There is an option FILELOCKWAIT you can use to get SAS to wait for a locked SAS dataset to free up so in effect the inserts happen sequentially.

http://support.sas.com/documentation/cdl/en/hostwin/67279/HTML/default/viewer.htm#n0fh4oaq31gvqkn1hl...

This option can be applied on a LIBNAME statement which you would need to use just prior to the SQL insert, then clear the LIBNAME immediately afterwards just to be safe.

Patrick
Opal | Level 21

The ways I know of how to achieve or simulate concurrent write to SAS tables:

1. SAS/Share

2. Filelockwait

3. Each process writes to its own table but you have a view over these tables. You then can use the view for downstream processing.

....ideally: You use a database table instead which allows concurrent write (eg. a table in Oracle).

Peter_C
Rhodochrosite | Level 12

I think a VIEW is the way to go.

On great feature it provides is the USING clause to define a libref / connection with options like FILELOCKWAIT

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1089 views
  • 2 likes
  • 4 in conversation