Hi,
I am sorting a dataset with id's
Have:
BR01-999-1001-002 |
BR01-999-1045-004 |
when i sort them, in the output the ids look like,
BR01-999-1001002 |
BR01-999-1045004 |
Any way the sort the data while keeping Ids as such in the input dataset??
Thanks,
this was an issue due to source dataset. thanks for the help though
Check the format and the format length (how many digits) has the ID variable.
Post your code.
data have;
input key $17.;
cards;
BR01-999-1001-002
BR01-999-1045-004
;
run;
proc print noobs;
run;
proc sort
data=have
out=want
;
by key;
run;
proc print noobs;
run;
gives this result
key BR01-999-1001-002 BR01-999-1045-004 key BR01-999-1001-002 BR01-999-1045-004
this was an issue due to source dataset. thanks for the help though
@ari please mark the question solved.
Check data in the input data set. It might have read incorrectly while reading from source
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.