LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 1999, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 21 Oct 1999 11:43:55 -0400
Reply-To:     RAITHEM <RAITHEM@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         RAITHEM <RAITHEM@WESTAT.COM>
Subject:      (MVS) Re:How to use SAS-Connect in order to launch a SAS-Uni
Comments: To: MOUVEROUX Vincent <Vincent.MOUVEROUX@GEP.FR>
Content-Type: text/plain; charset=US-ASCII

Vincent Mouveroux posted the following interesting question:

>I'm trying to do a very specific thing. My data are stored on Unix. Thus, >I've to use SAS-Unix to work with it. But I want to report the results with >a PC. I know that it's possible to launch a SAS-Unix job from a SAS-PC >session, using SAS-connect. Does anyone know how I can do this? >

Vincent, here at SAS Mecca we have do the same sort of thing; linking PC SAS (Windows 95) with Unix (HP-Unix) via SAS/CONNECT software. We have SAS/CONNECT installed on the Windows and the Unix platforms--a dead-solid prerequisite for remote processing, remote library services, etc. Here is an example of a SAS program that I would run from the PC to log onto Unix, upload a file, crunch the file on Unix, download the result set, and do a PROC PRINT on my (Windows 95) desktop:

/*******************************************************************/ /* Inform SAS/CONNECT that we are using TCP/IP to connect to UNIX1 */ /*******************************************************************/ options comamid=TCP remote=UNIX1;

/***********************************************/ /* Signon to UNIX1 using a UNIX script */ /* User is prompted for UNIX login and password*/ /***********************************************/ signon 'C:\sas612\connect\saslink\tcpunix.scr' ;

/*******************************************************/ /* Allocate a PC directory that contains SAS data sets*/ /*******************************************************/ libname PCLIB "c:\Data Files\VINCdata";

/********************************************************/ /* RSUBMIT this block of code to run on the UNIX1 server*/ /********************************************************/ RSUBMIT;

options nofmterr;

/******************************************************/ /* Allocate a UNIX directory to contain SAS data sets*/ /******************************************************/ libname UNIXLIB "/home/mikefile/sasdata";

/********************************************************/ /* Move SAS data set from desktop to Unix for processing*/ /*******************************************************/ proc upload data=PCLIB.demo1995 out=UNIXLIB.dem1995U; run;

/*********************************************************/ /* Summarize data on the Unix Server */ /*********************************************************/ proc summary nway data=UNIXLIB.dem1995U; class gender race; var cdays fdays; output out=summ1(drop=_type_) sum=; run;

/****************************************************/ /* Delete the data set from the Unix Server */ /****************************************************/ proc datasets library=UNIXLIB; delete dem1995U; run;

/*****************************************************/ /* Move summarized SAS data set from Unix to desktop */ /*****************************************************/ proc download data=summ1 out=PCLIB.summ1; run;

/*********************************************************/ /* End of block of SAS code that runs on the UNIX1 server*/ /*********************************************************/ ENDRSUBMIT;

options nofmterr nodate;

/*******************************/ /* Print out the results. */ /*******************************/ proc print data=PCLIB.summ1 noobs label; title1 'VINC Data'; title2 'Summarized on the UNIX1 Unix Server'; run;

The program, above, is so over-laden with comments that I won't even attempt to comment on it here! Just remember that to submit a program from your desktop (Windows) SAS session to run on the Unix server, you must sandwich it between an RSUBMIT and an ENDRSUBMIT command. Oh, yea, the SAS log for the processing that is done on the Unix server will magically appear in your desktop SAS session when the Unix processing has completed. I/you/we could have chosen to do the PROC PRINT on the Unix server--if so, the output would have appeared in our desktop SAS session as well. Not too shabby. Not too shabby at all!

Vincent, best of luck to you as you give your SAS programs an out-of-computer experience by sending them to execute on the Unix server!

I hope that this answer proves helpful now, and in the future!

Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Michael A. Raithel "The man who wrote the book on performance." E-mail: raithem@westat.com Author: Tuning SAS Applications in the MVS Environment ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The only justification in the use of force is to reduce the amount of force necessary to be used. -- Alfred North Whitehead ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Back to: Top of message | Previous page | Main SAS-L page