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 (January 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 7 Jan 2011 20:02:17 -0500
Reply-To:   "Kirby, Ted" <ted.kirby@LEWIN.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Kirby, Ted" <ted.kirby@LEWIN.COM>
Subject:   Maximum Size for Character Variables?
Content-Type:   text/plain; charset="us-ascii"

I have a rather messy CSV file (messy in the sense that the variable values are all over the place). I was surprised at how well PROC IMPORT did in creating a SAS dataset, especially if I set the GUESSINGROWS option high enough so that the variables have the correct format (character or numeric) and size. My question is:

Is there some sort of SAS option that restricts the size of character variables that will be read with PROC IMPORT? I have scanned the list of SAS Options in the SAS documentation on my PC, but did not any option name that seemed to deal with variable lengths (other than the MVARSIZE option that deals with the size of macro variables).

The reason for my question is that one instance of the character variable "overall" contains 1,026 characters. This occurs on the 1,323rd row of the CSV file. When I use PROC IMPORT to read the data and set GUESSINGROWS to 1,400 (to be sure SAS looks at the row with the longest instance of the "overall" variable), PROC IMPORT assigns a length of 500 to the "overall" variable, not the correct length of 1,026.

This question is somewhat academic because I have also read this file with an INPUT statement and the colon format modifier as in:

data client;

infile "c:\clientfile.csv" dsd missover lrecl = 20000 firstobs = 2;

input

ClientID :4.

fname :$22.

<lots of other variables>

Overall :$1026.

<lots more variables>

;

run;

but I just wanted to understand what was happening.

************* IMPORTANT - PLEASE READ ********************

This e-mail, including attachments, may include confidential and/or proprietary information,

and may be used only by the person or entity to which it is addressed. If the reader of this

e-mail is not the intended recipient or his or her authorized agent, the reader is hereby

notified that any dissemination, distribution or copying of this e-mail is prohibited. If you

have received this e-mail in error, please notify the sender by replying to this message

and delete this e-mail immediately.


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