BookmarkSubscribeRSS Feed
SASGeek
Obsidian | Level 7

Hello,

I successfully ran a PROC REPORT but can't find my file. Here's the code & relavant log.

 

Where do I find the file? I want it as N:\SAS Results\New.txt. When I refresh the Windows Explorer, it's no there

 

Thanks

 

proc export data = work.customer_file

     outfile = 'N:\SAS Results\New.txt'

     dbms = dlm;

     delimiter = '09'x;    

run;

 

 

--- clode snipped
41 data _null_;
42 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
43 %let _EFIREC_ = 0; /* clear export record count macro variable */
44 file ''N:\SAS Results\New.txt' delimiter='09'x DSD
44 ! DROPOVER lrecl=32767;
45 if _n_ = 1 then /* write column names or labels */
46 do;
47 put
48 "SALES_MKT_NAME"
49 '09'x
50 "SALES_REGION_NAME"
51 '09'x


--- code snipped

NOTE: The file 'N:\SAS Results\New.txt' is:
Filename=/sasdata/work/sasuser/BACON/'N:\SAS Results\New.txtt,
Owner Name=bacon,Group Name=bacon,
Access Permission=-rw-r--r--,
Last Modified=15Jun2022:22:20:27

NOTE: 3211240 records were written to the file 'N:\SAS Results\New.txt'.
The minimum record length was 130.
The maximum record length was 271.
NOTE: There were 3211239 observations read from the data set WORK.CUSTOMER_FILE.
NOTE: DATA statement used (Total process time):
real time 4.79 seconds
cpu time 4.80 seconds

3211239 records created in N:\SAS Results\New.txt from WORK.CUSTOMER_FILE.

3 REPLIES 3
Reeza
Super User

You're working on a SAS Server so what you see as the N drive isn't necessarily what the server has mapped as the N drive. 

 

Your file is here:

/sasdata/work/sasuser/BACON/'N:\SAS Results\New.txtt

 

You probably want to talk to your colleagues or SAS administrator on how to save the file in your location of choice. Unfortunately sometimes it's a two step process - save to server and then download/transfer the file to your local computer. The exact process depends on your setup and installation which is why an internal resource is your best approach to solve this issue. 

Tom
Super User Tom
Super User

The log shows where the file is:

NOTE: The file 'N:\SAS Results\New.txt' is:
Filename=/sasdata/work/sasuser/BACON/'N:\SAS Results\New.txtt,

The UNIX operating system where SAS was running wrote the file into the present working directory because you used a relative filename reference since the filename did not start with the root node, / .

 

If you want to write to what ever disk you have mapped to the N drive on the machine where you are running Enterprise Guide then have the system operators of the Unix machine where SAS is running mount that share somewhere in the Unix filesystem.  So if you have \\servername\sharename mapped to N: on the PC that is running Enterprise Guide and the Unix team mounted that as /sasdata/servername/sharename on the Unix side then change your code to point there.

outfile = '/sasdata/servername/sharename/SAS Results/New.txt'

Although why you would create a file (directory) with a space in the middle of it is beyond me.

Kurt_Bremser
Super User

As already mentioned, your SAS session runs on a UNIX server. Ask your SAS admins if the N: drive is mounted somewhere on the UNIX server, and the path to it if it is.

Maxim 44: no spaces in path names. Will make your future life much easier. Replace the blank with an underline.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 749 views
  • 0 likes
  • 4 in conversation