Help using Base SAS procedures

Ho Can I Write a Variable Value to SAS log From Proc Report

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Ho Can I Write a Variable Value to SAS log From Proc Report

For debugging purposes is there a way I can write a variable (column) value to the log in a PROC REPORT?

 

 

 


Accepted Solutions
Solution
‎04-21-2017 11:50 AM
Respected Advisor
Posts: 3,777

Re: Ho Can I Write a Variable Value to SAS log From Proc Report

This does what I think you are asking.  Why prints out twice I don't know.

 

proc report data=sashelp.class nowd;
   columns _all_;
   define _all_ / display;
   compute name;
      i + 1;
      call execute(cat('%put NOTE: ',name,' ',i,';'));
      endcomp;
   run;

 

 

View solution in original post


All Replies
PROC Star
Posts: 288

Re: Ho Can I Write a Variable Value to SAS log From Proc Report

You can output data on the proc report statement with for example, "out = my_rpt_data" and then just use a data _null_; with put statements to write variable values to the log.

Solution
‎04-21-2017 11:50 AM
Respected Advisor
Posts: 3,777

Re: Ho Can I Write a Variable Value to SAS log From Proc Report

This does what I think you are asking.  Why prints out twice I don't know.

 

proc report data=sashelp.class nowd;
   columns _all_;
   define _all_ / display;
   compute name;
      i + 1;
      call execute(cat('%put NOTE: ',name,' ',i,';'));
      endcomp;
   run;

 

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 224 views
  • 3 likes
  • 3 in conversation