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 (March 1999, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 25 Mar 1999 01:08:47 GMT
Reply-To:     LPogoda <lpogoda@AOL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         LPogoda <lpogoda@AOL.COM>
Organization: AOL http://www.aol.com
Subject:      Re: How can SAS read character variables containing many blanks?

I think we need to see some code. You **should** be able to do something along the lines of:

DATA FEE; INFILE 'FOO'; INPUT @1 FIE $CHAR20.; RUN;

The $charX formats preserve leading spaces - if your data have none, you can use $20. instead.

You don't say what platform you're on. The above will work on a mainframe against a fixed format file, or on a PC or UNIX box where ALL records in the file are at **least** 20 bytes long.

If that's not the case, you'll need to modify the INFILE statement to read INFILE 'FOO' LRECL = 20 PAD; or use the MISSOVER or STOPOVER options - see your manual.

If none of the above quite fits your situation, we need to see some code.

In article <36F96659.E9E6EE2F@merck.com>, Kevin Maro <Research_Labnospam@merck.com> writes:

>I have a simple question on read char variables: > >How can I read character variables containing 2 or more consecutive >blanks? > >For example, I have a flat file of one character variable and 4 records >like this: > >ABC DE >ABC DE >ABC DE FG >ABC DE FG > >If I use $20. or $char20. or & $20, I either get all blanks, or ABC for >all records. Could anyone give me some advice?


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