- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can you do a %INCLUDE at the end of your program?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
%include method is calling SAS program stored out side the current program. I want to know how to active it after SAS connect section finished.
if I just add an %include after SAS connect. the %include part will be executed immediately after the SAS connect (it doesn't know SAS connect section finished or not)
--so what i need is a trigger that can tell the %include that the SAS connect section is totally finished and %include can start.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Are you eventually looking for the WAITFOR statement or the XSYNC option?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
rsubmit remote=U_server WAIT=YES;