BookmarkSubscribeRSS Feed
saghaee
Calcite | Level 5

Hi, 

 

I have a program that I've been running for 4+ years in PC SAS without issue until recently. It's a long program that runs smoothly until it reaches this code (see below). It won't finish processing the code, so I abort it.  But when I rerun my program, in the same session, it works fine. Hoping somebody might have an idea what is causing this. Thank you. 

 

ods listing close; 
ods exclude all;
ods output modes=ht_modes;
proc univariate data=mom_vs_ge20 modes;
var ht;
by mrn;
run;
ods select all;
ods listing;

3 REPLIES 3
mkeintz
PROC Star

If the code you presented doesn't run the first time, but does run the second time - then clearly there is a difference between those two iterations.  And just as clearly (assuming the code you are showing us is unchanged between the two submissions), it must be due to some part of your program that precedes this code - i.e. somewhere in the code that you didn't show us.

 

There are some mighty smart and diligent folks on this forum - but they'd probably have to be clairvoyant to give a confident solution to your problem with the program fragment you have provided.

 

Provide the code, and the log (the whole log) that leads up to the point you choose to abort the program.  Put the program code - the whole code -  in the text box generated by the running man icon.

 

And provide the corresponding log - also using the running man icon.

 

Help us help you.

--------------------------
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

--------------------------
saghaee
Calcite | Level 5
Hi @mkeintz,
The full code would need to be modified to make it shareable on a public forum. However, I did want to say that when I abort the program and just rerun the proc univariate, it runs fine. For that reason, I'm not sure if it's the prior code that is responsible for this issue. I think the problem is the first attempt SAS makes to create the ht_modes dataset. When I abort the program, ht_modes is created but with a fraction of the records.
ballardw
Super User

IF you made absolutely no changes to the SAS program then talk to your SAS admin about what changes may have been made in your SAS environment.

 

 

If you have made any changes to the ODS statements in the program this would be, from the very limited code and no log, my main concern:

Make sure that there is at least one ODS destination active at the time the Univariate code attempts to execute (you show code closing one, if there are no others such as ODS HTML then there is not ODS output to generate).

Also, instead of ODS EXCLUDE ALL I might suggest ODS SELECT only the output you want instead.

 

My suspicion is that somewhere later in the code you do open another ODS destination other than Listing, or reset one when restarting, that is open again.

 

Otherwise I would comment out that shown section of the code and run the program and look very closely at the log for the entire job for any warnings or errors that may occur prior to this step.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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