- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello does anyone know if I can set proc contents to default to
set proc contents default 'order=varnum'?
I think my is set to collate.
I mean I do not want to have to type out
proc contents data={myfile} order=varnum;
run;
but
proc contents data={myfile};
run;
or
proc contents;run;
...is fine when I use it 10 -20 times a day and yes I know about abbreviations.
-TIA KJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Write a macro, such as CNTNTS below:
%macro cntnts (data=_last_);
proc contents data=&data varnum;
run;
%mend;
Then you can type:
%cntnts (data=mylib.mydata);
to get what you want for dataset mylib.mydata.
And you get the bonus of just typing:
%cntnts;
to report on the data set most recently created in your current sas session. That's why I put in the automatic variable _LAST_ as the default "data=" option in the macro definition.
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can't change this default. Happy typing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You'll have to check this, to see whether it is still supported. It might let you get away with typing one extra letter.
There used to be statement style macros available as part of the software. That means you could invoke a macro just by typing the name of the macro without a percent sign:
http://www.sascommunity.org/sugi/SUGI84/Sugi-84-179%20Henderson%20Kuhn.pdf
So you could create your own statement-style macro using:
%macro contentss / stmt;
contents order=varnum
%mend contentss;
Then in the body of your program, you would just have to type an extra "s":
proc contentss data=mydataset;
run;
SAS would automatically replace "contentss" with "contents order=varnum".
If that would be a viable solution for you, give it a try and see if it is still supported.