- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I need to run a sas program that has ksh extension instead of sas. What difference does this extension do?
Best regards,
Blue blue
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
.ksh is the extension for Korn Shell scripts. If the file is a SAS program then ideally change the suffix to .sas as .ksh is just wrong.
....but shouldn't be an issue to run a SAS program stored in a file with the wrong suffix.
HOW do you plan to run this program? An %include statement to it, in batch via your own script, or in batch using a scheduler ....(which could cause some issues if using a SAS OEM version of lsf which doesn't allow for scheduling files other than .sas).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thanks for the response. I have several csv files that I need to combine them and put in a folder. I wonder if KSH extension can do that.
in one of them I have:
./01_split.ksh
./02_split.ksh
./03_add_somthing.ksh
./04_abc_combine.ksh
./04_def_combine.ksh
Regards,
blue blue
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@GN0001 wrote:
Hello,
Thanks for the response. I have several csv files that I need to combine them and put in a folder. I wonder if KSH extension can do that.
in one of them I have:
./01_split.ksh
./02_split.ksh
./03_add_somthing.ksh
./04_abc_combine.ksh
./04_def_combine.ksh
Regards,
blue blue
The name and extension of the files is less important than it's content. You need to share what's IN these files for us to give you more guidance.
And yes, there are Unix/Korn Shell commands that allow to manipulate files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I agree with what @Patrick has said.
The very fact that Korn shell scripts are in use indicates that they have been around for quite some time. Seniors who have been around in the organization should be able to assist.,
You have said that you want combine csv file and move them to a folder. Going by your posts in this thread, I suggest consider using SAS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
From where do you know it's a SAS program? Did you read it to verify it contains SAS code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
KSH extension is sometimes used to indicate that the file contains korn shell commands.
But both SAS programs and Korn Shell programs are just text files. So look at the file and see whether it has SAS code or Unix commands. (or perhaps it has both).
If you don't know how to open the file with a text editor you can just have SAS read the file and dump the contents to the SAS log.
data _null_;
infile 'myfile.ksh' ;
input;
list;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @GN0001
Did you look at the file content? - It might be a korn script that executes a SAS program. If this is the case, the script contains a command to start SAS with the program path/name as one of the arguments. This gives you 3 possible ways of executing the SAS program:
- Copy the program path/name and run it in a SAS session with %include.
- Run the script from a command line, if you have direct access to the server.
- Run the script in a SAS session by using the X command, if you have the XCMD option set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In many organizations with SAS installed in UNIX/Linux environment , Korn shell scripts are used to call SAS programs.
These scripts may are typically executed by some sort of scheduler. It is quite possible that this may be the case.