I used the macro
%data2datastep(cars,sashelp,,5)
and created a new dataset but couldn't find it anywhere.
what should I do..??
You need to supply the dataset and library name of your dataset to the macro (1st and 2nd parameter). You should also supply a filename as the third parameter; place this file in your shared folder (if you use SAS UE) - ie "/folders/myfolder/dataset.sas", so you can find it from your Windows desktop. The 4th parameter sets the number of observations that will go into the datastep.
Then open the file from your desktop with a text editor and copy/paste its contents into a code window.
I did this >
%include '\act$\data2datastep.sas' /lrecl=1000;
%data2datastep(check, Actshare,Checking, 100);
Then I got this in log
NOTE: The file "Checking" is:
Filename=D:\sasconf\Config\Lev1\SASApp\Checking,
RECFM=V,LRECL=32767,File Size (bytes)=0,
Last Modified=10 August 2017 14:06:00,
Create Time=10 August 2017 14:06:00
NOTE: 105 records were written to the file "Checking".
The minimum record length was 4.
The maximum record length was 39.
NOTE: There were 100 observations read from the data set ACTSHARE.CHECK.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
Now I am not getting what to do next
So you positively do not use SAS UE.
Is that D:\ drive on a server, or do you have SAS locally installed on your 😧 drive?
If the latter, just open the Checking file with a text editor (from WIndows Explorer) and copy/paste the contents here.
If it's on a server, you need to specify a path to your "home" directory, so you can open the file with EG or SAS Studio from there.
But the problem is I cannot locate the file named Checking anywhere in my PC.
@guptagaurav12 wrote:
But the problem is I cannot locate the file named Checking anywhere in my PC.
Then it's likely you have a client/server setup and need to retrieve the file from the server.
@guptagaurav12 wrote:
I did this >
%include '\act$\data2datastep.sas' /lrecl=1000;
%data2datastep(check, Actshare,Checking, 100);
Then I got this in log
NOTE: The file "Checking" is:
Filename=D:\sasconf\Config\Lev1\SASApp\Checking,
RECFM=V,LRECL=32767,File Size (bytes)=0,
Last Modified=10 August 2017 14:06:00,
Create Time=10 August 2017 14:06:00NOTE: 105 records were written to the file "Checking".
The minimum record length was 4.
The maximum record length was 39.
NOTE: There were 100 observations read from the data set ACTSHARE.CHECK.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
Now I am not getting what to do next
The SAS log has told you where the file is. So use that information to let SAS just dump the text file to the log. You can copy and paste from the log.
data _null_;
infile 'D:\sasconf\Config\Lev1\SASApp\Checking';
input;
put _infile_;
run;
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.