- Author: admin
- Filed under: Auto-cars
- Date: Mar 12,2008
1.leaving off the period at the end of the format in a format statement, and
2.leaving off the dollar sign before a character format. If you leave out the proc format code in a program using a permanent file where formats are defined SAS will require the formats be available fro use. In this case you can either follow the instructions for including code (%include) above, or copy the proc format code into your current program.
3.You can also include the nofmterr option to allow the program to run with out errors. Another common error is to reference the format with a format statement before defining the format with proc format code. Read the rest of this entry »
- Author: admin
- Filed under: Auto-cars
- Date: Mar 12,2008
First, you must create the label formats with proc format using a value statement. Next, you attach the label format to the variable with a format statement. This format statement can be used in either proc or data steps. An example of the proc format step for creating the value formats, forgnf and $makef follows.
PROC FORMAT; VALUE forgnf 0=”domestic” 1=”foreign” ; VALUE $makef “AMC” =”American Motors” “Buick” =”Buick (GM)” “Cad.” =”Cadillac (GM)” “Chev.” =”Chevrolet (GM)” “Datsun” =”Datsun (Nissan)”;RUN;
You may include any number of value statements to create label formats as needed. Since make is a variable that contains character values, when you define the formats for it you have to precede the format name with a $ so the format name becomes $makef. Additionally, for character variables the values of the variables must be enclosed in quotes.
Read the rest of this entry »