Hello all;
How to use waiting method wait for the oracle task finish?
*---start from PC SAS; %put this is pc sas;
*----the oracle connection will create oraclelib.two
PROC SQL; CONNECT TO ORACLE AS ORA (USER="&user" PASSWORD="&pass" PATH = PA); EXECUTE (BEGIN CODE.CREATE_SASDATA.THREE('SASA',&sdate.,'Y'); END;); QUIT;
*----------need to wait here until last step finish,then can run the next data step;
data after_oracle;
infile ORACLELIB.two;
input a $100;
run;
Thanks!
You don't need to do anything. SAS's default behaviour is to wait until the Oracle step has completed.
Also if you are reading an Oracle LIBNAME connection the correct syntax is:
data after_oracle;
set ORACLELIB.two;
run;
You don't need to do anything. SAS's default behaviour is to wait until the Oracle step has completed.
Also if you are reading an Oracle LIBNAME connection the correct syntax is:
data after_oracle;
set ORACLELIB.two;
run;
Thank you!
More to the topic, how to do if I want the last data step runing WITHOUT waiting for oracle finish?
Thanks!
Run the Oracle update job separately from your Oracle read job. These could be two separate SAS batch jobs, or two separate EG sessions each running one of the jobs for example.
Is that possible to run these in same session? just add some SAS option ?
Thanks!
Yes it is possible to do this but not with a SAS option. Running SAS jobs in parallel rather than one after the other is not straightforward.
Personally I think the best way of doing this is to use a SAS product called SAS/CONNECT. This software allows you to start multiple SAS sessions from within the one SAS job so you can run any task in parallel.
If you don't have SAS/CONNECT you can start the parallel SAS sessions by using the X command: X 'SAS.EXE -sysin "Secondprog.sas" '; I wouldn't recommend this approach as it's pretty clunky and hard to get right. The SAS/CONNECT approach is way better.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.