How can I change the permissions on a file on a UNIX server from SAS that is on a windows server? File is created using PC SAS.

Reply
Occasional Contributor
Posts: 18

How can I change the permissions on a file on a UNIX server from SAS that is on a windows server? File is created using PC SAS.

here is the sample program:

filename l12ftps ftp "xmtfile12.xfr"

     cd="public"

user="**"

pass="**"

host="server";

data empty_file;

     file l12ftps;

run;

I need to change the permissions to rw-rw-rw..  or 666.  the file is created in SAS (non-UNIX) and ftp'd to a UNIX server where it is finally picked up by someone.  Proble is that our process won't pick it up becuase of the permission.

Any help would be greatly appreciated..


Super User
Super User
Posts: 6,495

Re: How can I change the permissions on a file on a UNIX server from SAS that is on a windows server? File is created using PC SAS.

Does your FTP server support the UMASK command?  You could try adding that into the FTP RCMD option.

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000178980.htm

If you transfer a file with the FTP access method and then cannot read the file, you might need to change the FTP server's UMASK setting.

If the FTP server supports a SITE UMASK setting, you can change the permissions of the file as shown in the following example:

filename in ftp '/mydir/accounting/file2.dat'

  host="xxx.fyi.xxx.com"

  user="john"

  rcmd='site umask 022'

  prompt

;

data _null;

file in;

put a $80;

run;

Occasional Contributor
Posts: 18

Re: How can I change the permissions on a file on a UNIX server from SAS that is on a windows server? File is created using PC SAS.

I will give it a try and see.

Thanks

Ask a Question
Discussion stats
  • 2 replies
  • 456 views
  • 0 likes
  • 2 in conversation