Under Enterprise Guide 7.11 (7.100.1.2711) 64 bit, with WIndows 7 SP1.
I'm using the following sas macro:
%macro a(factor)
data input;
informat &factor._C best12.;
set input;
&factor_C=&factor;
run;
proc univariate data=input;
var &factor._C;
histogram &factor._C/normal(noprint) cbarline=grey;
run;
%mend;
It worked properly, but in the log, it returns me the error with the wrong column (compared to the original dataset input).
Ex:
the observation's column was 257 (which has the issue), but the log of the macro returns my column 27 (which doesn't have an issue).
So, why does this macro change the order of my observations? Or does the macro change the order in general?
Thank you.
You are inconsistent in your question.
Do ask about the order of the columns, or the order of the observations?
Creating a new variable in a statement after the set statement will have this new column appear last within the observations, naming it before the set statement will put it first in the PDV and therefore in the output dataset.
A simple data step like yours will not change the order of observations.
Sorry about the messed up, I'm always a little bit messed up with the rows/columns with the observations/factors.
And yes, I'm asking about the rows/observations.
I was wondering if this is because of the default ASC/DSC options with the new factors created in the macro?
Will this changed the order of my observations?(Since I added one new factors for all observations)
Thank you.
Jin
So, the question is, which ERROR are you getting?
And can you supply some test data (in a data step) so we can reproduce the behaviour?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.