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 (June 1996, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 18 Jun 1996 20:22:16 GMT
Reply-To:   Michael Little <little@PSCI.SAS.UPENN.EDU>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Michael Little <little@PSCI.SAS.UPENN.EDU>
Organization:   University of Pennsylvania
Subject:   Re: Tabs in PUT statement

John Iwaniszek (johni@BRINC.USA.COM) wrote: : Kevin :

: Use the '09'x character to put tabs to your text file. 09 is the hex : code for tab and the assignment statement '09'x places the tab character : into the variable x. The following example illustrates how to use th : enew variable in a put statement.

: put : name '09'x address '09'x phone : ;

: John Iwaniszek

To save a few keystrokes, you can use group formats:

-------------------------------------------------- array varnam{*} $ varnam1-varnam4 ('name' 'address' 'phone' 'etc'); if _n_=1 then put (varnam{*}) ($20. '09'x); put (name address phone etc) ($20. '09'x); --------------------------------------------------

The above will write out the the names of the vars on the first output record.

Also, somewhere in the SAS-L archives lives a macro that will do all of the above automatically (the only change I needed was to change the delimiter to '09'x). Search on some part of the beginning lines of the macro excerpt below. Thanks to Phil Mason for the macro!

---------------------------------------------------------------------- %* Date: Thu, 11 Aug 1994 07:21:00 EST ; %* Reply-To: "Mason, Phil" <PMason@VCRPMRKT.TELECOM.COM.AU> ; %* Sender: "SAS(r) Discussion" <SAS-L@MARIST.BITNET> ; %* From: "Mason, Phil" <PMason@VCRPMRKT.TELECOM.COM.AU> ; %* Subject: Re: How to export SAS dataset to Excel ? ;

%MACRO MAKETSV(DSET,CSV,LIMIT=,TITLE=,EXTRA=) ; ----------------------------------------------------------------------

- Mike

-- Michael Little, Social Science Computing, U of PA 353 McNeil, phone: 215-573-3331, 215-898-6454 little@ssc.upenn.edu


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