| Date: | Tue, 18 Jul 2006 16:32:45 -0400 |
| Reply-To: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Subject: | Re: Proc Export? |
|
Thomas,
I don't know why SAS behaves in that manner, but it definitely does. The
manual suggests that it would only behave, as it does, when attempting to
output dbf files.
Regardless, one manual solution would be do run your job as currently
coded. Then, after it is done, recall last submit (from either the icon,
menu or clicking on function key 4), and then modifying the code to
something like the following:
data _null_;
set MISSING end=EFIEOD;
file 'c:\test\test.txt' delimiter='09'x DSD DROPOVER lrecl=32767;
format a best12. ;
format b best12. ;
format c best12. ;
format d $1. ;
if _n_ = 1 then /* write column names */
do;
put
'a'
'09'x
'b'
'09'x
'c'
'09'x
'd'
;
end;
do;
put a 2. '09'x b 2. '09'x c 2. '09'x d $2. ;
;
end;
run;
Other than removing some of the unnecessary overhead, the principal line I
changed was the fourth line from the end, i.e., a put with specific
formats for all of the variables (including specifying the desired
delimiter).
That appears to produce the desired file.
HTH,
Art
---------
On Mon, 17 Jul 2006 16:09:45 -0500, Thomas A. Schmitt <schmitta@UWM.EDU>
wrote:
>Hi Group:
>
>
>
>I have the following data set. When I print the data set it gives me the
>periods for missing values but when I try to export the data set I no
longer
>have the periods as missing. Thanks for any help.
>
>
>
>Tom
>
>
>
>DATA _NULL_;
>
>PROC IMPORT DATAFILE="C:\test\test.xls"
>
>OUT=WKCE_2005 REPLACE;
>
>GETNAMES=YES;
>
>RUN;
>
>DATA missing;
>
>SET WKCE_2005;
>
>ARRAY replace[*] _character_;
>
> DO I = 1 TO DIM(replace);
>
> IF replace[I] = ' ' THEN replace [I] = '.';
>
>END;
>
>DROP I;
>
>RUN;
>
>PROC PRINT DATA=missing;
>
>run;
>
>PROC EXPORT DATA=missing
>
>OUTFILE="test\test.txt"
>
>replace;
>
>RUN;
|