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-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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.

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
  • 5 replies
  • 1412 views
  • 4 likes
  • 2 in conversation