Usage Note 23637: How can I dynamically FTP output from ODS from a SAS job?
To dynamically transfer output by FTP from a SAS job, specify
the FILENAME statement with the
FTP access method. This creates the output file
on the target host.
In the HOST= argument,
specify the IP address or the string that your site uses to connect to the host.
Below is an example that creates
the file x.html in my home directory on my UNIX server.
For
full documentation, see the FILENAME statement in the OnlineDoc.
filename temp ftp '~my-user-id/x.html'
user='my-user-id' host='node.company.com'
pass='xxxx'
recfm=s
prompt debug;
ods html body=temp;
proc print data=sasuser.class;
run;
ods html close;
The above method only works with a single body file. If you have multiple
files to FTP, such as multiple body files, or the supporting files such as the
table of contents and the frame file, you can use the below approach on the PC
to create a ZIP file. Otherwise, you need multiple FILENAME statements
with the FTP access method to FTP each file.
The below example pipes all of the files generated with ODS to a ZIP file. It
is then the ZIP file that is FTP'd. If you have SAS Integration Technologies,
then you can create a package to send. For more information, see the example
"Publishing with the FTP Access Method" in SAS Integration Technologies
Developer’s Guide.
options noxwait noxsync;
ods listing close ;
ODS HTML PATH='c:\test'(URL=NONE)
body='body.html'
contents='contents.html'
frame='frame.html' newfile=proc;
/* sample Data */
proc print data=sashelp.class;
title "first title";
run;
proc print data=sashelp.houses;
title2 'second title';
run;
ODS HTML CLOSE;
/* Use the Pipe command to pipe all of the body files generated and */
/* all of the supporting files. */
filename zipit pipe 'c:\winzip\wzzip.exe c:\test.zip c:\body*.html
c:\contents.html c:\frame.html';
data _null_;
file zipit;
put 'The will zip the files';
run;
filename zipit clear;
/* FTP the zipped file created */
filename moveit ftp '~my-user-id/test.zip'
host='node.company.com' prompt debug
user='my-user-id'
pass='abc123' recfm=f;
data _null_;
file moveit;
put;
run;
ods listing;
See also Universal Printing topics in
SAS Language Reference: Concepts in the SAS online documentation.
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | low |
Topic: | SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> HTML Third Party ==> Output ==> PDF Third Party ==> Output ==> Postscript Third Party ==> Output ==> RTF
|
Date Modified: | 2007-10-01 11:55:14 |
Date Created: | 2004-01-06 14:31:56 |