Variable length and format width are independent things
The LENGTH is how many bytes SAS uses to store the data in the dataset. Since SAS uses 64 bit floating point numbers the length of a numeric variable must be between 3 and 8 bytes. (You can actually store numbers in as few as 2 bytes on IBM mainframes since they used a different floating point representation.) The WIDTH used by a format or informat is how many characters it takes to print the value as text. So if you are reading or writing a string like $1,205.93
you will need to use 9 characters. But since it is a number you will want to store it with 8 bytes. So the LENGTH is 8 even if the format width is longer than that.
List mode input ignores informat widths
The second confusion is that when you are using list mode INPUT (rather than formatted mode) then SAS will ignore the width specified on any informat that you might have attached to a particular variable. Instead it will apply the informat to all of the next word that it sees before the next delimiter. You could consider that it adjusts the informat width to match the width of the data. So if ran a program like this:
data want ;
input id cost ;
informat cost comma1. ;
cards;
1 $103.93
;
COST will get set properly because the width of 1
specified in the informat statement is ignored. Note that the same thing applies when using the :
modifier to allow the informat specification to be inserted into the INPUT statement without causing SAS to switch from list mode to formatted mode.
Misuse of the decimal part of an informat specification
On a FORMAT the decimal specification tells SAS how many digits to the right of the decimal place to print. But when you add a decimal specification on an INFORMAT you are telling SAS where to place the decimal point when the input string does not have one. Basically you are telling SAS what power of 10 to use to divide any integer values that it sees. So unless you are positive that your input stream intentionally eliminated the periods between the ones and tenths places you should never specify any decimal value for a INFORMAT. So you wouldn't want to use the DOLLAR12.2 informat. (Note also that there is no difference between the DOLLAR. and COMMA. informats. Both remove commas and dollar signs before trying to translate the string into a number.)