Hi. I have this code where I print out only the variable names. I saw all the discussions on left justification, but they all require ODS.
Is there a way USING NO ODS to justify to the left the var names in the last proc statement?
* export the variable names and their position number into a data set called "data_info";
proc contents
data = maosim.case_5_pre_and_post_mgnew
noprint
out = data_info
(keep = name varnum);
run;
* sort "data_info" by "varnum";
* export the sorted data set with the name "variable_names", and keep just the "name" column;
proc sort
data = data_info
out = variable_names(keep = name);
by varnum;
run;
* view the list of variables;
proc print
data = variable_names
noobs ;
run;
I tried this and it did not work. Perhaps I have placed the options in the wrong statement ----
* export the variable names and their position number into a data set called "data_info";
proc contents
data = maosim.case6apre_6bpost_mgf
noprint
out = data_info
(keep = name varnum);
run;
* sort "data_info" by "varnum";
* export the sorted data set with the name "variable_names", and keep just the "name" column;
proc sort
data = data_info
out = variable_names(keep = name);
by varnum;
run;
* view the list of variables;
proc print OPTIONS NOCENTER
data = variable_names
noobs ;
run;
I tried this and it did not work. Perhaps I have placed the options in the wrong statement ----
* export the variable names and their position number into a data set called "data_info";
proc contents
data = maosim.case6apre_6bpost_mgf
noprint
out = data_info
(keep = name varnum);
run;
* sort "data_info" by "varnum";
* export the sorted data set with the name "variable_names", and keep just the "name" column;
proc sort
data = data_info
out = variable_names(keep = name);
by varnum;
run;
* view the list of variables;
proc print OPTIONS NOCENTER
data = variable_names
noobs ;
run;
THIS HERE WORKED !!!!! YAYE!!!! Thanks for the idea and start... you were very helpful!
* export the variable names and their position number into a data set called "data_info";
proc contents
data = maosim.case6apre_6bpost_mgf
noprint
out = data_info
(keep = name varnum);
run;
* sort "data_info" by "varnum";
* export the sorted data set with the name "variable_names", and keep just the "name" column;
proc sort
data = data_info
out = variable_names(keep = name);
by varnum;
run;
* view the list of variables;
options linesize=132 pagesize=60 nocenter date;
proc print
data = variable_names
noobs ;
run;
Its a good idea to mark the person who provided you the solution's post as the answer, not your own response.
Anyways, that code is not needed, you can simply (please note the use of the code window, its the {i} above the post are):
options nocenter;
proc print data=sashelp.vcolumn noobs;
where libname="MAOSIM" and memname="CASE6APRE_6BPOST_MGF";
run;
I am not, just mark the poster who provided the solution, in this case @MichaelLarsen, as the correct answer. Just to note for future as I don't think you can change it now. Never actually seen that kudos and what not thing, just want the actual answer to appear below the question, makes future searches easier.
Michael,
I can not find your email to apologize. I really did not know the rules for accepting a solution. Thank you for informing me.
Should there be as SAS COMMUNITY RULE documents? I am not greedy and I thought I gave credit to you.
I am sorry.
I hope the SAS community accepts our mistakes are we not SAS experts per se, and don't know the rules.
I thought everyone was suppose to be kind and open instead of critical. But I have learned.
Thank you again for the solution.
Marysia
No problem at all
Like RW9 says, if the actual solution is marked, it is easier for others having a similar problem to find the solution.
It is not about personal glory
Michael,
I can not find your email to apologize. I really did not know the rules for accepting a solution. Thank you for informing me.
Should there be as SAS COMMUNITY RULE documents? I am not greedy and I thought I gave credit to you.
I am sorry.
I hope the SAS community accepts our mistakes are we not SAS experts per se, and don't know the rules.
I thought everyone was suppose to be kind and open instead of critical. But I have learned.
Thank you again for the solution.
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.