BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nasser_DRMCP
Lapis Lazuli | Level 10

hello,

  

I need to print the table description (here "cars" ) into a log file. my problem is that log file holds more than the script like this"

 

NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds"

"

But what I would like to obtain in the log file is :


create table SASHELP.CARS( label='2004 Car Data' bufsize=16384 )
  (
   Make char(13),
   Model char(40),
   Type char(8),
   Origin char(6),
   DriveTrain char(5),
   MSRP num format=DOLLAR8.,
   Invoice num format=DOLLAR8.,
   EngineSize num label='Engine Size (L)',
   Cylinders num,
   Horsepower num,
   MPG_City num label='MPG (City)',
   MPG_Highway num label='MPG (Highway)',
   Weight num label='Weight (LBS)',
   Wheelbase num label='Wheelbase (IN)',
   Length num label='Length (IN)'
  );

 

proc printto log="/home/ldap/mellouna/log_macro_scrip_tables.txt" new; run;




proc sql;

describe table sashelp.cars ;

quit;

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
r_behata
Barite | Level 11
proc printto log="/home/ldap/mellouna/log_macro_scrip_tables.txt" new; run;

options nostimer;

proc sql nofeedback;

describe table sashelp.cars ;

quit;

Try this

View solution in original post

7 REPLIES 7
FreelanceReinh
Jade | Level 19

Hello @Nasser_DRMCP,

 

Start your program with:

options nonotes nosource;

to suppress the unwanted text in the log file.

r_behata
Barite | Level 11
proc printto log="/home/ldap/mellouna/log_macro_scrip_tables.txt" new; run;

options nostimer;

proc sql nofeedback;

describe table sashelp.cars ;

quit;

Try this

Nasser_DRMCP
Lapis Lazuli | Level 10

hello r_behata,

thanks for the solution you suggested. I have a subsidiary question.
I would like to print only creation tables scripts  for many tables so I have developed a loop in a maco.

but, in the log, there is still information regarding the execution that I woul like to prevent the print.

like this

MPRINT(MC_LIBRARY_TABLE_LIST2):   quit;
MPRINT(MC_LIBRARY_TABLE_LIST2):   Data _null_;
MPRINT(MC_LIBRARY_TABLE_LIST2):   Set t_tables_list(firstobs=2 obs=2);
MPRINT(MC_LIBRARY_TABLE_LIST2):   Call symputx('mv_table_name',memname);
MPRINT(MC_LIBRARY_TABLE_LIST2):   run;
===========> CLASSFIT options nostimer nonotes nosource
MPRINT(MC_LIBRARY_TABLE_LIST2):   proc sql nofeedback ;
MPRINT(MC_LIBRARY_TABLE_LIST2):   describe table SASHELP.CLASSFIT ;

proc printto log="/home/ldap/mellouna/log_macro_scrip_tables.txt" new;  run;

%macro mc_library_table_list2(p_lib_name) ;

proc sql;
   create table t_tables_list as
   select memname from dictionary.tables
   where libname="&p_lib_name" and memtype="DATA" and memname like 'CL%';
quit;

data _null_;
if 0 then set work.t_tables_list nobs=n;
call symput('mv_numobs',n);
stop;
run;

%do i=1 %to &mv_numobs;
    Data _null_;
    Set t_tables_list(firstobs=&i obs=&i);
    Call symputx('mv_table_name',memname);
    run;
%put ===========> &mv_table_name
options nostimer nonotes nosource;
proc sql nofeedback ;
  describe table &p_lib_name..&mv_table_name. ;
quit;

%end;

%mend ;

%mc_library_table_list2(p_lib_name=SASHELP) ;
PaigeMiller
Diamond | Level 26

Use

 

options nomprint;
--
Paige Miller
Nasser_DRMCP
Lapis Lazuli | Level 10

thanks a lot PaigeMIler ! perfectly my need !

Nasser_DRMCP
Lapis Lazuli | Level 10

hi PaigeMiller

 

sorry, but I still need some help.

by specifying "options nomprint", the result is muchbetter but there is still "The SAS System" printed.

thanks a lot in advance

saslove
Quartz | Level 8

Try this. It print as html. You can export it also. 

 


ods html file="test.html";
proc document name=temp(write);
import textfile="path\import.sas" to ^;
replay;
run;
ods html close;

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
  • 7 replies
  • 839 views
  • 1 like
  • 5 in conversation