Lucas
before writing to FTP, practise in using SAS to copy files. Here is example 1[pre]data _null_ ;
infile 'a simple text file.txt' lrecl=10000 ;
file 'a copy.txt' lrecl=10000 ;
input ;
put _infile_ ;
run; [/pre]* notice that lrecl. It ensures you use up to 10000 of each line.
Example 2: using filename statements ; [pre]filename ffrom 'a simple text file.txt' lrecl=10000 ;
filename fileTO 'a copy.txt' lrecl=10000 ;
data _null_ ;
infile ffrom ;
file fileto ;
input ;
put _infile_ ;
run; [/pre] * see how similar. Just using file refs instead;
* next Example 3 making a binary copy;[pre]filename ffrom 'a binary file.stc' lrecl=80 recfm=F ; [/pre] * and fill it with a cport file ;[pre]proc cport data= sashelp.class file= ffrom;
run ;[/pre] * might as well be something familiar ;[pre]filename fileTO 'copy of cport.stc' lrecl=80 recfm= f ;
data _null_ ;
infile ffrom pad ;
file fileto ;
input ;
put _infile_ ;
run;[/pre]* and lets check it is OK ;[pre]proc cimport lib= work file= fileto ;
run; [/pre] * beginnng to look familiar? ;
* I guess you noticed an extra thing on the INFILE statement. That PAD option ensures the end-of-file coming inside the multiple of 80 will not cause trouble;
* finally the FTP Example ;
* just use your FTP filename statement with, perhaps no more;[pre]filename myFTP ftp "&target_path_ftp/&file_name..stc" binary lrecl= 80 recfm=F ;
* you already have a binary file defined;
data _null_ ;
infile ffrom pad ;
file fileto ;
input ;
put _infile_ ;
run;[/pre] * and you will have to try that yourself;
OK The transfer over FTP should define binary in the filename statement for a binary file especially when transferring to a different encoding system (like zOS in ebcdic from an ascii environment like windows or unix). You may want to transfer only text. In that case drop the RECFM= and set LRECL= to a size at least large enough for your widest line.
is that enough example?
good luck
peterC
doc for filenameFT is at
http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000178980.htm