BookmarkSubscribeRSS Feed
annypanny
Quartz | Level 8

Hi,

I am using the below code but at the output location nothing is showing, is there any different way to write a file other than proc export.

proc export data = final 
outfile = "c:\mysas\output"
dbms=dlm replace;
delimiter=',';
putnames=no;
run;

 

Thanks in advance

 

9 REPLIES 9
ed_sas_member
Meteorite | Level 14

Hi @annypanny 

 

It seems that the extension in missing in the OUTFILE option:

"c:\mysas\output.xxx"

 

Best,

annypanny
Quartz | Level 8

thanks but no help from that, applied this but still not showing anything to that location

proc export data = final 
outfile = "c:\mysas\output.csv"
dbms=dlm replace;
delimiter=',';
putnames=no;
run;

ed_sas_member
Meteorite | Level 14

Hi @annypanny 

 

Could you please share the log resulting from the submission?

 

Best,

annypanny
Quartz | Level 8
the log is of 185 lines. Can I paste all?
Kurt_Bremser
Super User

Unless you have a licensed local SAS installation (rather rare these days), this won't work.

If you use University Edition, it cannot see your C: drive, only the shared folder defined when you set up UE.

If you use On Demand for Academics, you can only create files in your home directory on the AWS Linux server, and need to download the file from there.

If you use a server-based setup in your company/university, you may have a C: drive (if it is a Windows server), but it it is not the one of your desktop PC.

So the most important information first: what type of SAS setup do you use?

 

Since a PROC EXPORT creates a data step and writes that to the log, it will be rather extensive, but we can deal with 185 lines in a </> window.

annypanny
Quartz | Level 8

proc export data = final
25 outfile = "c:\mysas\output.csv"
26 dbms=dlm replace;
27 delimiter=',';
28 putnames=no;
29 run;

NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
30 /**********************************************************************
31 * PRODUCT: SAS
32 * VERSION: 9.4
33 * CREATOR: External File Interface
34 * DATE: 26MAY20
35 * DESC: Generated SAS Datastep Code
36 * TEMPLATE SOURCE: (None Specified.)
37 ***********************************************************************/
38 data _null_;
39 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
40 %let _EFIREC_ = 0; /* clear export record count macro variable */
41 file 'c:\mysas\output.csv' delimiter=',' DSD DROPOVER lrecl=32767;
42 set FINAL end=EFIEOD;
43 format Number $8. ;
44 format fund $100. ;
45 format date1 best12. ;
46 format date2 best12. ;
47 format date3 best12. ;
48 format date4 best12. ;
49 format date5 best12. ;
50 format date6 best12. ;
51 format date7 best12. ;
52 format date8 best12. ;
53 format date9 best12. ;
54 format date10 best12. ;
2 The SAS System 06:04 Tuesday, May 26, 2020

55 format date11 best12. ;
56 format date12 best12. ;
57 format date13 best12. ;
58 format date14 best12. ;
59 format date15 best12. ;
60 format date16 best12. ;
61 format date17 best12. ;
62 format date18 best12. ;
63 format date19 best12. ;
64 format date20 best12. ;
65 format date21 best12. ;
66 format date22 best12. ;
67 format date23 best12. ;
68 format date24 best12. ;
69 format date25 best12. ;
70 format date26 best12. ;
71 format date27 best12. ;
72 format date28 best12. ;
73 format date29 best12. ;
74 format date30 best12. ;
75 format date31 best12. ;
76 format date32 best12. ;
77 format date33 best12. ;
78 format date34 best12. ;
79 format date35 best12. ;
80 format date36 best12. ;
81 format date37 best12. ;
82 format date38 best12. ;
83 format date39 best12. ;
84 format date40 best12. ;
85 format date41 best12. ;
86 format date42 best12. ;
87 format date43 best12. ;
88 format date44 best12. ;
89 format date45 best12. ;
90 format date46 best12. ;
91 format date47 best12. ;
92 format date48 best12. ;
93 format date49 best12. ;
94 format date50 best12. ;
95 format date51 best12. ;
96 format date52 best12. ;
97 format date53 best12. ;
98 format date54 best12. ;
99 format date55 best12. ;
100 format date56 best12. ;
101 format date57 best12. ;
102 format date58 best12. ;
103 format date59 best12. ;
104 format date60 best12. ;
105 format date61 best12. ;
106 do;
107 EFIOUT + 1;
108 put Number $ @;
109 put fund $ @;
110 put date1 @;
111 put date2 @;
112 put date3 @;
3 The SAS System 06:04 Tuesday, May 26, 2020

113 put date4 @;
114 put date5 @;
115 put date6 @;
116 put date7 @;
117 put date8 @;
118 put date9 @;
119 put date10 @;
120 put date11 @;
121 put date12 @;
122 put date13 @;
123 put date14 @;
124 put date15 @;
125 put date16 @;
126 put date17 @;
127 put date18 @;
128 put date19 @;
129 put date20 @;
130 put date21 @;
131 put date22 @;
132 put date23 @;
133 put date24 @;
134 put date25 @;
135 put date26 @;
136 put date27 @;
137 put date28 @;
138 put date29 @;
139 put date30 @;
140 put date31 @;
141 put date32 @;
142 put date33 @;
143 put date34 @;
144 put date35 @;
145 put date36 @;
146 put date37 @;
147 put date38 @;
148 put date39 @;
149 put date40 @;
150 put date41 @;
151 put date42 @;
152 put date43 @;
153 put date44 @;
154 put date45 @;
155 put date46 @;
156 put date47 @;
157 put date48 @;
158 put date49 @;
159 put date50 @;
160 put date51 @;
161 put date52 @;
162 put date53 @;
163 put date54 @;
164 put date55 @;
165 put date56 @;
166 put date57 @;
167 put date58 @;
168 put date59 @;
169 put date60 @;
170 put date61 ;
4 The SAS System 06:04 Tuesday, May 26, 2020

171 ;
172 end;
173 if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */
174 if EFIEOD then call symputx('_EFIREC_',EFIOUT);
175 run;

NOTE: The file 'c:\mysas\output.csv' is:
Filename=c:\mysas\output.csv,
Owner Name=sasinst,Group Name=sasusers,
Access Permission=-rwxrwxr-x,
Last Modified=26 May 2020 13:58:57 o'clock

NOTE: 91 records were written to the file 'c:\mysas\output.csv'.
The minimum record length was 442.
The maximum record length was 533.
NOTE: There were 91 observations read from the data set WORK.FINAL.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.02 seconds

91 records created in c:\mysas\output.csv from FINAL.


NOTE: "c:\mysas\output.csv" file was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):

Kurt_Bremser
Super User

This is important:

NOTE: "c:\mysas\output.csv" file was successfully created.

The file was created, and since the name was not changed in any way to adhere to UNIX name conventions, your SAS runs on a Windows system where you have write access to C:\mysas.

But if that Windows system is a remote server, you won't see the result on your desktop.

So the important question is: do you use a client/server environment, or a local SAS? Which interface do you use (SAS Studio, Enterprise Guide, Display Manager)?

Kurt_Bremser
Super User

If Enterprise Guide connects to a remote server (so the server you use in EG is not "Local"), then the file is created there, and you won't be able to access it on your desktop. Either use the Export task in EG (this can write to the local environment), or the File Copy task to copy the file once it is created through code.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 9 replies
  • 737 views
  • 0 likes
  • 3 in conversation