DATA Step, Macro, Functions and more

SAS Temporary array

Reply
Contributor
Posts: 29

SAS Temporary array

Hi everbody,

 

I have a question.

 

Is

Array vec1{10} $25. _TEMPORARY_;

 

ok? The array elements should have the length 25.

 

Bye, cons

Regular Contributor
Posts: 240

Re: SAS Temporary array

Yes it is correct. Array of 10 character element whose length would be 25.

 

Super User
Posts: 9,671

Re: SAS Temporary array

No DOT 

 

Array vec1{10} $ 25  _TEMPORARY_;

Regular Contributor
Posts: 240

Re: SAS Temporary array

Hi Ksharp,

 

You may be correct, but it also works with DOT.

 

Regards

Rahul

Super User
Posts: 10,483

Re: SAS Temporary array

The $ 25 is saying character Length 25. So the period gets interpreted as a decimal in $ 25. and Length ignores decimal values. If you use Length x $ 25.3 the variable will have a length of 25.

 

 

Respected Advisor
Posts: 4,644

Re: SAS Temporary array

[ Edited ]

So @RahulG, @cons, what's the problem?

PG
Ask a Question
Discussion stats
  • 5 replies
  • 274 views
  • 2 likes
  • 5 in conversation