BookmarkSubscribeRSS Feed
Kirito1
Quartz | Level 8
data work.shoes;
    infile "/folders/myfolders/import/shoes.csv"
	delimiter = ","
	missover 
	dsd
	firstobs=2;
 
	informat Region $50.;
	informat Product $50.;
	informat Subsidiary $50.;
	informat Stores best12.;
	informat Sales dollar12.;
	informat Inventory dollar12.;
	informat Returns dollar12.;
 
	format Region $50.;
	format Product $50.;
	format Subsidiary $50.;
	format Stores best12.;
	format Sales dollar12.;
	format Inventory dollar12.;
	format Returns dollar12.;
 
	input
	Region $
        Product $
	Subsidiary $
	Stores
	Sales
	Inventory
	Returns;
run;

I have two Questions regarding above Code.

1. What is the difference between best12. and dollar12. ?

2. Why are we putting $ sign in input statement?

Can give the summary of the code and answer 2 of the above Questions I have. 

Any help is appreciated.

Thanks in Advance 

 

Regards

1 REPLY 1
ballardw
Super User

The DOLLAR format displays  values with a national language currency symbol. The BEST format attempts to display a value in the given number of characters.

 

The input statement in this case does not need a $ because the INFORMAT statements indicate the variables are character. If you did not have an Informat or ATTRIBUTE statement indicating the values are to be character then the $ on the input would default to reading up to 8 characters into a character value.