On Fri, 16 Jul 2004 09:26:44 -0700, David Fickbohm <DavidF@HOMEGAIN.COM>
>I have a field that contains the number 1 through 5 representing different
>purposes for entering a website. I think I am correct in saying that if
>use a format to show a word instead of a number in that field the field
>still have a number when I export the final dataset to excel. Am I
>? I think the only way to actually show the word is to use an if and
>new variable to the dataset if x = 1 then "word"
>Am I correct ?
>Data Mining Analyst
>2450 45th St.
>Emeryville, CA, 94608
>Phone 510 655 0800 ext 4151
this is one reason I prefer to avoid the proc export
The alternative is a fairly simple datastep... unless
you have a lot of variables, when the sql prefix helps
The data step
file 'your.csv.file.csv' lrecl=30000 dsd ;
put 'var1,var2,var3,........lastVar'; ***see below;
do while( not eof) ;
set your_data_set end=eof ;
*** Only at that marked line do you need to put any var names.
They should be in order, separated by commas ;
If you have too many variables to list like this, you
can get sql to generate the list for you.....
proc sql noprint;
into :names_head separated by ","
where libname = "%upcase(your_lib_name)"
& memname = "%upcase(your_mem_name)"
order by varnum ;
After that, the ***marked line would be
put &names_head ;
With this method, all default formats in your data would be
respected, when the csv file is created.