Help using Base SAS procedures

waitfor after connect oracle

Accepted Solution Solved
Reply
Regular Contributor
Posts: 230
Accepted Solution

waitfor after connect oracle

[ Edited ]

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!


Accepted Solutions
Highlighted
Solution
‎09-08-2017 12:27 PM
Super User
Posts: 3,233

Re: waitfor after connect oracle

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


All Replies
Highlighted
Solution
‎09-08-2017 12:27 PM
Super User
Posts: 3,233

Re: waitfor after connect oracle

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;
Regular Contributor
Posts: 230

Re: waitfor after connect oracle

Thank you!

 

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

 

 

Thanks!

Super User
Posts: 3,233

Re: waitfor after connect oracle

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.

Regular Contributor
Posts: 230

Re: waitfor after connect oracle

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

 

Thanks!

Super User
Posts: 3,233

Re: waitfor after connect oracle

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.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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