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 (January 2002, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 8 Jan 2002 17:13:30 -0500
Reply-To:   Talbot Michael Katz <TopKatz@MSN.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Talbot Michael Katz <TopKatz@MSN.COM>
Subject:   DOS copy command with %sysexec

Hey, gang!

My immediate question concerns the use of the copy command in Windows with % sysexec. I'll start with that, but that's just the surface issue. If I issue the copy command from a DOS command line as copy /b /y "file1" + "file2" /b "file1" ; it will execute fine up to a length of 127 characters for the line (which imposes a constraint on the lengths of the filenames). If I issue the corresponding command within SAS : %sysexec copy /b /y "&uc." + "&up." /b "&uc." ; it only seems to work up to 122 characters (starting from the copy and ending with the last quotation mark). At 123 characters it does nothing. For 124 or more, it issues an error box : c:\windows\ a device attached to the system is not functioning.

The difference between the SAS DOS and native DOS environments is only mildly annoying. The bigger problem is, with long filenames allowed, and virtually unlimited length full path names, I could easily exceed 127 characters in that copy command. So, how can I concatenate files with long pathnames within a SAS program?

I could breathe a bit easier with the length issue if I could switch directories to where the files are (let's assume the two files are in the same directory for now) before the copy, but I'm not sure how to get multiple DOS commands into a single %sysexec (if that's possible; I imagine it should be, because I can leave the window open and execute commands at will, depending on my xwait setting).

Why am I doing all this to begin with? It has to do with remote submission. A typical remote submission job looks like :

filename rlink 'C:\Program Files\SAS Institute\SAS\V8 \CONNECT\SASLINK\Tcpwin.scr'; options remote= <remote-server-name> ; signon; rsubmit;

/* your code here will run on remote server */

endrsubmit; signoff;

Suppose you wish to run an existing program from your hard drive on the remote server. You can't just put %include(program_name) between the rsubmit and endrubmit statements, because anything in there is run as if it's on the remote server. So, you can either copy and paste your program in between those statements, or create a new program file with the original program sandwiched between those statements. I wrote a routine to generate such files automatically and then include them and either save or get rid of them afterwards. I used the %sysexec copy as described above to create the "sandwich" file. So, my next question is, does anyone know a slicker way to run an existing program remotely without having to copy and paste?


-- TMK --

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