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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2634 views
  • 0 likes
  • 3 in conversation