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

Hi,

My SAS log file suddenly becomes the following. I need to know how many observations were read in and how many observations are saved in new data etc. How can I get them back in log file? 

Many thanks.


Sunny



1695     

1696      data a;

1697       set out.regdata(keep=mtime todays_state tomorrows_state);

1698       if mtime<=mdy(4,1,2014) &  todays_state=0 & tomorrows_state in(0,1,4)

1698    & mtime<mdy(5,1,2014) ;

1699      run;

1700      quit; run;

1701      ODS _ALL_ CLOSE;

1702      ODS _ALL_ CLOSE;

1703      FILENAME WPSWBHTM TEMP;

1704      ODS HTML(ID=WBHTML) BODY=WPSWBHTM GPATH="R:\WPS\TEMP\sunyi\WPS Temporary Data\_TD4152"

1704    ! ;

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Sure just put these at the end of code:

%let dsid=%sysfunc( out.regdata);

%let in=%sysfunc(attrn(&dsid,nlobs));

%let dsid=%sysfunc(&dsid);

%let dsid=%sysfunc( a);

%let out=%sysfunc(attrn(&dsid,nlobs));

%let dsid=%sysfunc(&dsid);

footnote "&in  obs read in, &out obs be output";

ods _all_ close;

Xia Keshan

View solution in original post

8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, that shows that the compiler isn't actually executing this.  Its normally due to having unbalanced quote marks, however in this instance I would assume its broken due to the use of ampersand (&) rather than the word AND.

So start a new session (especially with quotes, you can sometimes never clear it without re-starting), then change the code to:

if mtime<=mdy(4,1,2014) and  todays_state=0 and tomorrows_state in(0,1,4) and mtime<mdy(5,1,2014) ;

Also ensure that all your single and double quote marks have a corresponding ending single or double quote.

Sunny_Sun
Calcite | Level 5

Thanks. It was a very long statement. So when I copied them to prepare the question, I shortened them. It was right when I ran it in SAS. 

For example,

data a;

     set b;

   

run;

in the log file, there is no observation information. It was fine before. For example, it usually tells how many observations have been read in from source data and how many observations are saved in destination data set.  But suddenly it disappeared.

Can you please tell me how I can get them back in log file?

Thanks,

Sunny

Patrick
Opal | Level 21

You can influence via SAS options how much log information you're getting. If things suddenly changed without you doing anything then may be some SAS admin changed the options on a higher level.

If you execute "proc options; run;" you can see in the log which options are currently set in your session.

Many of the SAS options can be set or overwritten during run time. Below a few options which will create more log information. Add them on top of your code and let us know if this changed things for you.

options fullstimer msglevel=i notes source source2;

options spool;

option sastrace=',,,d' sastraceloc=saslog nostsuffix;

Ksharp
Super User

Sure just put these at the end of code:

%let dsid=%sysfunc( out.regdata);

%let in=%sysfunc(attrn(&dsid,nlobs));

%let dsid=%sysfunc(&dsid);

%let dsid=%sysfunc( a);

%let out=%sysfunc(attrn(&dsid,nlobs));

%let dsid=%sysfunc(&dsid);

footnote "&in  obs read in, &out obs be output";

ods _all_ close;

Xia Keshan

Sunny_Sun
Calcite | Level 5

Many thanks! It works

JuanS_OCS
Amethyst | Level 16

Any chance that you are making use on the code / or on your autoexec/config file / or on the options of your SAS client software / some options to modify the behaviour of your log?

Some examples:

Step-by-Step Programming with Base SAS(R) Software

Tom
Super User Tom
Super User

Perhaps you have some unbalanced quotes, parentheses or macro definitions and SAS is merely echoing the statements to the log because it thinks they are all part of a long quoted string for example.

If it is really running then add :

OPTIONS NOTES;

and it should start writing notes again.

Sunny_Sun
Calcite | Level 5

Many thanks all of you! It works.

Have a good thanksgiving holiday.

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

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

 

Register now!

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
  • 8 replies
  • 1456 views
  • 0 likes
  • 6 in conversation