今回はFORMATステートメントについて解説します。
/* format */
data data1;
Id1=111111;
output;
run;
data data2; set data1;
format Id1 dollar11.2;
run;
![](https://how-to-business.com/wp-content/uploads/2022/01/format_1.png)
![](https://how-to-business.com/wp-content/uploads/2022/01/format_2.png)
- formatステートメントにより、Id1はDOLLAR11.2の出力形式に変換できる。
- DOLLAR11.2は$を入れた11桁、小数点以下2桁
/* format_2 */
data data1;
Id1=111111;
output;
run;
data data2; set data1;
format Id1 $11.2;
run;
![](https://how-to-business.com/wp-content/uploads/2022/01/format_2_1.png)
![](https://how-to-business.com/wp-content/uploads/2022/01/format_2_2.png)
- formatステートメントにより、Id1はDOLLAR11.2の出力形式に変換できる。
- $11.2はエラーになる。