BookmarkSubscribeRSS Feed
cons
Calcite | Level 5

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.

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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...

 

 

cons
Calcite | Level 5
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.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

cons
Calcite | Level 5
$4 means 4 bytes the same with numeric variables. i.e. age 4 is 4 bytes
FreelanceReinh
Jade | Level 19

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2945 views
  • 0 likes
  • 3 in conversation