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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.