LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 1 Dec 2004 13:24:59 -0600
Reply-To:     "Dunn, Toby" <Toby.Dunn@TEA.STATE.TX.US>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Dunn, Toby" <Toby.Dunn@TEA.STATE.TX.US>
Subject:      Re: Format question
Comments: To: Roberto Valdivia <valdivia@montana.edu>
Content-Type: text/plain; charset="us-ascii"

In that case use _numeric_ which will get all the numerics.

Toby

-----Original Message----- From: Roberto Valdivia [mailto:valdivia@montana.edu] Sent: Wednesday, December 01, 2004 1:24 PM To: Dunn, Toby; SAS-L@LISTSERV.UGA.EDU Subject: RE: Format question Importance: High

Thanks for your answers!..I forgot to mention that the variable names are different (sorry, in the example I wrote X1, X2..X50...) so in many cases I have like X1, W3, WX12, RT14...etc..

Thanks!

Roberto.

-----Original Message----- From: Dunn, Toby [mailto:Toby.Dunn@tea.state.tx.us] Sent: Wednesday, December 01, 2004 12:12 PM To: Roberto Valdivia; SAS-L@LISTSERV.UGA.EDU Subject: RE: Format question

Roberto,

This makes it simplier: Data a;

Some sas code here

Run;

DATA TEST; SET A; FORMAT X1-X50 15.6; Run;

PROC DBF DATA=TEST DB4=TEST; RUN;

Or this might even work depending on your sas code in data step A:

Data A ; format x1-x50 16.5 ;

Some sas code here ;

Run ;

PROC DBF DATA = TEST DB4 = TEST ; RUN ;

However, I am not sure if you can use the format statement in proc dbf but if you can this would be better:

Data A ;

Some sas code here.

Run;

PROC DBF DATA = TEST DB4 = TEST; format x1-x50 15.6; RUN;

HTH Toby Dunn -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Roberto Valdivia Sent: Wednesday, December 01, 2004 1:01 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Format question Importance: High

Hello to all!, Could somebody help me with a simple question?..Thanks!:

I have a program and at the end I want to export the final database to a dbf file, To do that I have to format the variables. What happens is that I have many variables (sometimes more than 50), so instead of writing the name of all the variables, is there any other way I can do this?. Below is the structure of the program I use to write to dbf.

Thanks! Roberto.

*define dbf output file; FILENAME TEST 'c:\DATABASE\OUTPUT.DBF';

DATA A;... : : *PROCESS HERE; :

* write to dbf; DATA TEST; SET A; FORMAT X1 X2 X3 ....... .... X50 15.6;

PROC DBF DATA=TEST DB4=TEST; RUN;


Back to: Top of message | Previous page | Main SAS-L page