BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
gpandzik
Calcite | Level 5

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!

1 ACCEPTED SOLUTION

Accepted Solutions
JerryV
SAS Employee

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

3 REPLIES 3
JerryV
SAS Employee

Will either of these work?

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

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

gpandzik
Calcite | Level 5

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!

jagjit_sas
Calcite | Level 5

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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