07-01-2015 09:01 AM
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.
07-01-2015 06:14 PM
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.
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.
07-01-2015 06:34 PM
The ways I know of how to achieve or simulate concurrent write to SAS tables:
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).
07-01-2015 07:07 PM
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
Need further help from the community? Please ask a new question.