1

I don't understand the difference between "format", "informat" and "length".

JJJ
  • 32,902
  • 20
  • 89
  • 102
bluehaiku
  • 11
  • 1
  • 4

2 Answers2

2

Informat -> how a value is read in, for example if it's a numeric value with a $ and comma it would be a dollar12. Informat.

Format -> how a value is displayed.

Length -> number of spaces/bytes assigned to store variable information.

Format and length can differ - length of $12 but a format of $5 means only 5 characters are displayed.

http://blogs.sas.com/content/sasdummy/2007/11/20/lengths-and-formats-the-long-and-short-of-it/

Joe
  • 62,789
  • 6
  • 49
  • 67
Reeza
  • 20,510
  • 4
  • 21
  • 38
  • I have a question too. whether the displaying length of variable is beyond the storing length of the variable. Thank you! – bluehaiku Sep 23 '16 at 11:29
0

Length is the maximum length of the entries. If the length of a text variable is 8 then text entries with a length of more than 8 characters will be trimmed. The format of this text variable would then be "$8.". It is the format of the variable. For text variables, you can see from both, format and length, the maximum length of your variable. Please read something about format of numbers or date variables, these are large topics well explained in the SAS help.

Joe
  • 62,789
  • 6
  • 49
  • 67
Tobi
  • 206
  • 1
  • 4