Hello everyone,
I run a main SAS program in PC, in this program SAS CONNECT will be used to connect UNIX and run SAS program in UNIX.
after running the UNIX SAS program,the main PC SAS program will run another final program in PC local.this final program will need the output dataset generated from the last UNIX program.
My question is how to create a trigger program so the final program in PC will begin to run after the UNIX SAS program is done?
Thanks!
Have the PC SAS job look for the existence of a file every minute or so.
Have the Unix SAS program create that file when it's finished.
Thank you very much!
Read the new file and check its status for every several minutes.
that is a very useful solution but it cost I/O too much also need created some extra file and code. I hope there is a better way to to this.
Thanks!
Can you do a %INCLUDE at the end of your program?
Are you eventually looking for the WAITFOR statement or the XSYNC option?
Thank you Patrick,
The waitfor statement should be what I need.but it not works, please help me correct my code in detail:
*A program of PC SAS; libname PC_lib "c:\temp\test123"; data PC_lib.one; x=1; run; *--connect to unix using SAS connect; %connect(U_server,abc);/*a macro use SAS connect to connect from PC to UNIX*/ rsubmit remote=U_server WAIT=NO;
libname unix_lib "...";/*unix_lib is a library in UNIX*/
data unix_lib.two; y=2; run;
endrsubmit; signoff remote=userver;
WAITFOR _ALL_ userver;
libname u_map "......."; /*u_map is a mapping drive in PC ,it will point to UNIX drive unix_lib*/
* need u_map.two ready before try to create PC_lib.three;
data PC_lib.three;
set PC_lib.one u_map.two;
run;
Thanks!
Look at the WAIT option you're using in your RSUBMIT statement.
You've specifically set it to run back to back rather than to wait for the connect to finish. If you remove that option, it waits and a %INCLUDE will work.
Thank you Reeza,
I am confuse about what you said. would you please modify my code and show me where to make changes? that will greatly help me.
Thank you very much!
rsubmit remote=U_server WAIT=YES;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.