Solved

How to create empty file in SAS?

Posted on 2015-02-09
3
316 Views
Last Modified: 2016-02-13
I am simply trying to create an empty file in SAS.

Is this a correct way or may be there is a more efficient way?  I am just want to create an empty file, not a SAS dataset.

filename myfile "/mydir/emtyfile.done";

data _null_;
 'x touch myfile';
run; 

Open in new window

0
Comment
Question by:labradorchik
3 Comments
 
LVL 7

Expert Comment

by:James Bilous
ID: 40599618
This discussion from the SAS forums has several solutions depending on exactly what you desire:

https://communities.sas.com/message/104612
0
 
LVL 14

Accepted Solution

by:
Aloysius Low earned 500 total points
ID: 40599935
that is definitely not the correct code, unless you want the filename of the file created to be myfile, in the default execution directory.

if you use x command, you are passing the entire instruction to the OS to execute, so it has to be correctly structured, and appear exactly how you would do so when in the command line:
x "touch /mydir/emtyfile.done";

Open in new window


it can also run standalone, without being needed to be enclosed in a data step.

this is the quickest way to do what you need to do, assuming also that you have command line access within your SAS session.. otherwise, you'll need to write a data step to create an outfile
0
 

Author Comment

by:labradorchik
ID: 40628885
Hello, I am sorry for the late response!
Below code worked just fine!

data _null_;
 x "touch myfile";
run; 

Open in new window


Thank you for your help!!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
This is about my first experience with programming Arduino.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now