This code is basically to use FTP from SAS, i hope you guys can use it at many places.
FTP data from sas to mainframe or any place : (i use the code to ftp to mainframe , but it works for any other place too)
%let userId=
%let pwdId=
%let MVSZoS = MVSIBM.test.a; /* or give a ip address as /*
%let MVSZoS = 10.255.255.1; /* if u have the ip use this */
%let tempfile=c:\test_Ftp.prm; /*this is the input file you want to ftp (on from server)*/
%let out=myid.test.recieve.ftp; /* this is the file name to recieve ftp (on to server)*/
%let scr=c:\ftpparmameters.scr; /* this is a script file, just create a blank empty file on your
server ( from serve) */
filename f "&scr";
data _null_;
file f;
put "open &MVSZoS";
put "&userId";
put "&pwdId";
put 'cd ..';
put "send &tempfile" " &out";
put 'quit';
run;
%macro makework;
data _null_;
infile makework;
input;
put _infile_;
call symput('timestmp',datetime() );
run;
%mend;
%makework;
filename makework pipe "ftp -s:&scr";
This is more or less a general code , just change the parameters in let statements and you make it yours !
Like to hear your comments.
Thanks,
KB
Helpful post, thanks for sharing this coding.
ReplyDeleteRegards,
SAS Training Institutes in Chennai | SAS Institutes in Chennai
I think this is an great blogs. Such a very informative and creative contents. These concept is good for these knowledge.I like it and help me to development very well.Thank you for this brief explanations.
ReplyDeleteSalesforce Training | Online Course | Certification in chennai | Salesforce Training | Online Course | Certification in bangalore | Salesforce Training | Online Course | Certification in hyderabad | Salesforce Training | Online Course | Certification in pune