Help using Base SAS procedures

Can I redirect PROC SETINIT to OUTPUT instead of LOG?

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Can I redirect PROC SETINIT to OUTPUT instead of LOG?

I am a SAS Administrator using a Linux/Unix version of SAS, and I would like to be able to automatically scrape PROC SETINIT output from stdout, rather than having to scrape log files. I found the -stdio invocation option (from here: http://support.sas.com/documentation/cdl/en/hostunx/61879/HTML/default/viewer.htm#unx-sysopt-stdio.h...), but the PROC SETINIT output goes to the LOG, which contains a lot more information than I need or want to have to filter. I've tried using ODS and PROC PRINTTO to redirect the LOG-bound output of PROC SETINIT to the OUTPUT destination, thus sending the PROC's output over stdout instead o, f stderr, but I haven't had any success.

Is it possible to redirect SETINIT output (and only SETINIT output) to stdout, or am I over-thinking this? Any suggestions would be greatly appreciated. Thanks!


Accepted Solutions
Solution
‎10-09-2014 04:49 PM
SAS Employee
Posts: 11

Re: Can I redirect PROC SETINIT to OUTPUT instead of LOG?

Will either of these work?

sas -initstmt "proc setinit; endsas;" -nonotes -nonews -stdio

sas -initstmt "proc setinit; endsas;" -nonotes -nonews -nodms 1>&2

View solution in original post


All Replies
Solution
‎10-09-2014 04:49 PM
SAS Employee
Posts: 11

Re: Can I redirect PROC SETINIT to OUTPUT instead of LOG?

Will either of these work?

sas -initstmt "proc setinit; endsas;" -nonotes -nonews -stdio

sas -initstmt "proc setinit; endsas;" -nonotes -nonews -nodms 1>&2

New Contributor
Posts: 3

Re: Can I redirect PROC SETINIT to OUTPUT instead of LOG?

I used the first command with a redirection into grep to filter out a few extra lines some of our canned start-up scripts add (allocating some Meta-based libraries that produced NOTE: lines, that kind of thing).

This is what I came up with, and it fits the bill pretty well:

sas -initstmt "proc setinit; endsas;" -nonotes -nonews -stdio 2>&1 | grep -v -e "NOTE:" -e "User:" -e " The SAS System" -e "^$"

Thanks!

New Contributor
Posts: 2

Re: Can I redirect PROC SETINIT to OUTPUT instead of LOG?

I am also trying to achieve that in windows . can somebody please tell me how can i do that using base sas code?

thanks

jagjit

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 550 views
  • 0 likes
  • 3 in conversation