SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

I see no errors in the logs but  the  file  just not copying  into the second  folder

Is this the right command?

 

x "copy /x/y/z/deals&FOLDERNAME..txt

/xx/yy/zz/deals&FOLDERNAME..txt" ;

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

I believe you should use 'cp' command

 

x "cp /x/y/z/deals&FOLDERNAME..txt /xx/yy/zz" ;
Thanks,
Jag

View solution in original post

4 REPLIES 4
Jagadishkatam
Amethyst | Level 16

I believe you should use 'cp' command

 

x "cp /x/y/z/deals&FOLDERNAME..txt /xx/yy/zz" ;
Thanks,
Jag
Kurt_Bremser
Super User

If you use the X statement, you should check the automatic macro variable &sysrc afterwards to see if the command succeeded.

 

To make the responses from the command visible in SAS, use the filename pipe method:

filename oscmd pipe "cp /x/y/z/deals&FOLDERNAME..txt /xx/yy/zz/deals&FOLDERNAME..txt 2>&1";

data responses;
length response $256;
infile oscmd;
input;
response = _infile_;
put _infile_;
run;

This will keep the responses both in the dataset and the SAS log.

The "2>&1" construct redirects error output into the pipe.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 4443 views
  • 3 likes
  • 4 in conversation