Posts

Showing posts with the label sas

How to sort address alphabetically in SAS?

How to sort address alphabetically in SAS? I have a dataset that has bunch of addresses. dataset PROC SORT DATA=work68; by ADDRESS ; run; However it only show ADDRESS columns like .. it considers only the very first number of address.. ADDRESS 2237 Strang Avenue 2932 Ely Avenue 3306 Wilson Ave 3313 Wilson Avenue 3313 Wilson Avenue 3313 Wilson Avenue 46 Nuvern Avenue 3 Answers 3 You can use the option SORTSEQ=LINGUISTIC(NUMERIC_COLLATION=ON) to ask SAS to try and sort numeric values as if they were numbers. SORTSEQ=LINGUISTIC(NUMERIC_COLLATION=ON) PROC SORT DATA=work68 sortseq=linguistic(numeric_collation=on); by ADDRESS ; run; how about alphabets in the address?? – juhee Chung Jul 2 at 4:23 I'm not entirely ...

formatting date variable doesn't work

formatting date variable doesn't work I am doing data step using the following code. data meme; infile '/home/bronx.txt' dlm='09'x truncover firstobs=2; length ADDRESS $12. DATE 8. GROSS 5. LAND 8. SALE 6. YEAR 4. ZIP 6.; format DATE mmddyy10.; input ADDRESS $ ZIP LAND GROSS YEAR SALE DATE; run; Nonetheless, this error always accures: WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed. 1 Answer 1 Looks like you do not understand what SAS formats and informats are for. A FORMAT is instructions for converting the stored value into text. To go the otther way you need to use an INFORMAT . So if the text in your file looks like 01/01/2016 then you would want to use the MMDDYY informat (or perhaps the DDMMYY informat). If it looks like 01JAN2016 then you will want to use the DATE informat. If you want to value to look like dates when ...