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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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