length mob DQ_6 $20.;
Does this mean putting both mob and DQ_6 into format of length 20 ?
Length will limit the number of characters stored. If another format is not defined those variables will default to a $20 display format. Character variables typically default to the length. Numeric variables default to BEST, usually Best12. and has nothing to do with the length.
A Format assignment can override that default format at any point.
The $20 applies to both of the variables preceding it.
It's not exactly a format (which is usually intended to tell SAS how to display a value) - as a LENGTH statement, it tells SAS to store the data in mob and in DQ_6 as strings of length 20 characters.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.