BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GeorgeSAS
Lapis Lazuli | Level 10

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!

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

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;

View solution in original post

5 REPLIES 5
SASKiwi
PROC Star

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;
GeorgeSAS
Lapis Lazuli | Level 10

Thank you!

 

More to the topic, how to do if I want the last data step runing WITHOUT waiting for oracle finish?

 

 

Thanks!

SASKiwi
PROC Star

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.

GeorgeSAS
Lapis Lazuli | Level 10

Is that possible to run these in same session? just add some SAS option ?

 

Thanks!

SASKiwi
PROC Star

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.

SAS Innovate 2025: Register Now

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!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2005 views
  • 4 likes
  • 2 in conversation