Hello,
Based on the sas documentation (https://documentation.sas.com/api/docsets/engspde/9.4/content/engspde.pdf?locale=en), it is recommended to copy a spde file from source to destination using the command similar to the one below:
libname source spde 'source_path';
libname dest spde 'destination_path';
proc copy in=source out=dest;
select Fname;
run;
However, the task a need to do it to generate a ksh file, using a SAS program to generate this ksh file, then that will be executed on a unix server ex: KshScript_1.Ksh
This file contains instructions such as:
mkdir path2
cp path1/file_1 path2/file_1
cp path1/file_2 path2/file_2
cp path1/file_3 path2/file_3
....
cp path1/file_n path2/file_n
But which instruction could I use for a spde file?
What's the best way to take care of the spde files, I mean to copy them from source to destination.
Regards,
SPDE files has the absolute path in the meta data header file, so it's adviced not to use OS command to copy/move these files.
Not sure why you can't use a SAS program to do this, or why you should creata a ksh using SAS... (perhaps by sing SAS disctionary tables to generete code dynamically?)
You can have a ksh calling SAS and the SAS copy program.
Hello,
I understand your question and the answer is simple.
We don't have access to the production server for security purpose.
So we need to provide to the admin, a ksh file that will gather all together, instructions such as:
mdir -m777 /rootdir1
mdir -m777 /rootdir1/path1
....
cp rootdir/path1/file1 /rootdir1/path1/file1
cp rootdir/path1/file2 /rootdir1/path1/file2
libname source spde '&rootdir/path1'; libname dest spde '&rootdir1/path1'; proc copy in=source out dest; select file1;run;
So my task is to put all those instructions into the same file.
Is there a way to do that?
Please note that as we have unix and sas commands in the same file.
What's the best way to do that?
Regards
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.