DATA Step, Macro, Functions and more

What's the equivalent of a varying character data type in SAS?

Reply
Contributor
Posts: 71

What's the equivalent of a varying character data type in SAS?

I.E a variable length character with no padding. 

Super User
Posts: 13,084

Re: What's the equivalent of a varying character data type in SAS?

Posted in reply to tomcmacdonald

@tomcmacdonald wrote:

I.E a variable length character with no padding. 


Not really such a thing. When a character variable is created it has a fixed length. If you try to stuff more than the created/assigned length then the value will be truncated to the length.

 

"Padding" may not quite be what you think it is depending on how you use the variable.

Super User
Posts: 5,829

Re: What's the equivalent of a varying character data type in SAS?

Posted in reply to tomcmacdonald
For SAS9 as @ballardw states there is no real VARCHAR data type. You can use compress to gain some similar advantage, but that acts on the whole record.
But in Viya, SAS has introduced the VARCHAR data type 😊
Data never sleeps
Ask a Question
Discussion stats
  • 2 replies
  • 91 views
  • 2 likes
  • 3 in conversation