| Date: | Wed, 23 May 2007 14:53:11 +0100 |
| Reply-To: | Guido T <cymraegerict@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Guido T <cymraegerict@GMAIL.COM> |
| Subject: | Re: SAS database into TXT |
|
| In-Reply-To: | <BAY123-F163C468A9F04C8974927E9DE350@phx.gbl> |
| Content-Type: | text/plain; charset=WINDOWS-1252; format=flowed |
Hi Toby,
Neat, but unfortunately everything is quoted ...
"Alfred","M","14","69.0","112.5"
not just the character vars.
++ Guido
On 23/05/07, toby dunn <tobydunn@hotmail.com> wrote:
> While I gave the code to do this once I will do it again:
>
> ODS CSV Body = "/export/home/dunnt/Junk.txt" ;
> Proc Print
> Data = SASHelp.Class NoObs ;
> Run ;
> ODS CSV Close ;
>
> No need to worrie about making sure you have all the variables in your put
> statement, one format for the nnumeric and one for the character, nor that
> the format lengths are correct.
>
>
>
> Toby Dunn
>
> On the other hand, you have different fingers. ~ LCG
>
> The early bird may get the worm, but the second mouse gets the cheese in the
> trap. ~ LCG
>
> What happens if you get scared half to death, twice? ~ LCG
>
>
>
>
>
> From: "data _null_;" <datanull@GMAIL.COM>
> Reply-To: "data _null_;" <datanull@GMAIL.COM>
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: SAS database into TXT
> Date: Wed, 23 May 2007 09:33:15 -0400
>
> Based on the following from the DOCs I would think you are correct.
> If w is too small the format "returns" blank.
>
> $QUOTEw.
> Syntax Description
> w
> specifies the width of the output field.
> Default: 8 if the length of the variable is undefined; otherwise, the
> length of the variable + 2
>
>
> On 5/23/07, Robert Bardos <bardos2@ansys.ch> wrote:
> >Way cool! Thanks. Goes right into my bag of tricks.
> >
> >BTW: for testing purposes I added another loong string and changed
> >$quote12. to $quote. Do I risk anything by doing that (I mean by
> >not explicitly stating the length)?
> >
> >Robert
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: SAS(r) Discussion
> > > [mailto:SAS-L@LISTSERV.UGA.EDU]Im Auftrag von
> > > Richard A. DeVenezia
> > > Gesendet: Mittwoch, 23. Mai 2007 15:01
> > > An: SAS-L@LISTSERV.UGA.EDU
> > > Betreff: Re: SAS database into TXT
> > >
> > >
> > > Miguel de la Hoz wrote:
> > > > Hi everybody,=0A=0AI am trying to convert a SAS file
> > > with numeric and
> > > > character info into the following TXT
> > >
> > > The FILE option DLM and $QUOTE format fit the bill.
> > >
> > > data foo;
> > > file log dlm=',';
> > >
> > > x =1;
> > > a ='a';
> > > y=2;
> > > b='b';
> > > z=3;
> > > c='c';
> > >
> > > format _numeric_ best12.;
> > > format _character_ $quote12.;
> > >
> > > put x--c;
> > > run;
> > >
> > > --
> > > Richard A. DeVenezia
> > > http://www.devenezia.com/
> > >
> > >
> >
>
> _________________________________________________________________
> More photos, more messages, more storage—get 2GB with Windows Live Hotmail.
> http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507
>
|