DATA Step, Macro, Functions and more

Differences between SAS BASE 9.2 and 9.4

Reply
Contributor
Posts: 29

Differences between SAS BASE 9.2 and 9.4

Hello everybody,

 

I have my base exam tomorrow. But, I have still some questions.

1. Look at

PROC FORMAT ;

VALUE valuename

...

RUN;

What is the valuename format default length? At 9.2 it's 8 byte. At 9.4 it's 31 or 32 bytes. If I get exam question then I have to answer 31 or 32 bytes?

2. Look at default informat length at 9.4: Is it still 8 bytes for numeric variable and 8 bytes for character variables?

3. Look at target variable at 9.4: The target variable by tranwrd has the length 200 bytes as default?

 

Thanks in advance.

 

Bye.

Super User
Super User
Posts: 7,401

Re: Differences between SAS BASE 9.2 and 9.4

Sorry, your questions are confusing.  I wouldn't have expected that in a SAS exam, they would ask you about byte storage, that is outside the scope of a SAS question.  Do you mean default character length, then that is 8.

For tranwrd, yes, you are correct per the documentation:

http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p0pgemqcslm...

 

 

Contributor
Posts: 29

Re: Differences between SAS BASE 9.2 and 9.4

With the LENGTH statement you define the Byte storage. There are questions about the length by variables at base exam. I would like to know the thing with valuename. Thank you so much for your help.
Super User
Super User
Posts: 7,401

Re: Differences between SAS BASE 9.2 and 9.4

Have never come across a need to know this, however I would say Length assigns the length in character spaces, i.e. length $4 means four characters.  If those characters are exactly a byte, then yes it is the same, but I wouldn't have thought knowing how SAS assigns data into the underlying file structure is outside the bounds of a SAS test.

Contributor
Posts: 29

Re: Differences between SAS BASE 9.2 and 9.4

$4 means 4 bytes the same with numeric variables. i.e. age 4 is 4 bytes
Trusted Advisor
Posts: 1,115

Re: Differences between SAS BASE 9.2 and 9.4

Hello @cons,

 

As to the remaining questions in your initial post:

 

  1. The default length of format VALUENAME depends on the labels in the format definition. Typically (if there are no references to other formats or functions using the [...] notation), it will be the length of the longest label.

    Your "31 or 32" sound like the maximum lengths of format names (31 for character formats, not counting the leading dollar sign, and 32 for numeric formats), which were increased in SAS 9 (not only SAS 9.2) compared to SAS 8, where they were 7 and 8 respectively.

  2. To my knowledge, "SAS uses w.d as the default numeric informat and $w. as the default character informat" (see documentation of INFORMAT statement), but these informats don't have default lengths (unlike many other informats).

    In particular, there is no general default informat length of "8 bytes" and this has not changed between SAS 9.2 and SAS 9.4. Please don't confuse this with the default length of numeric or character variables.
Ask a Question
Discussion stats
  • 5 replies
  • 587 views
  • 0 likes
  • 3 in conversation