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

I am  doing

proc sql;
           describe table &lib..&mem
        ;quit;

 

.. where I write the log the log to a file:

 

%let logfile=C:\SAS_table.log;

proc printto log="&logfile" new;

 

 

The other day, it output a full line like this  (no new lines)

create table SASHELP.BURROWS( label='Isopod Burrow Locations and Covariates from an Israeli Desert' bufsize=65536 )

 

Today, it is breaking it into 2 lines:   where there is a new line  before  'bufsize=65536 )'

 

create table SASHELP.BURROWS( label='Isopod Burrow Locations and Covariates from an Israeli Desert'
bufsize=65536 )

 

I have made no changes to the code and no one else has made system changes.

I tried using   LINESIZE=MAX, but has no effect.

 

Is there a way to make this a fixed length?

1 ACCEPTED SOLUTION

Accepted Solutions
dougcrites
Fluorite | Level 6

Tom, that worked!  Actually, I had tried setting the LS  option, but I did it higher in the program,  where it obviously did not affect this particular code.   Thank you!

View solution in original post

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

I would recommend that, whenever you need output, to write a report and put that into a file.  Log/Output window, they are plain text and don't have the necessary functionality to create nice outputs.

You can do it simply by:

proc report data=sashelp.vtable nowd;
  columns _all_;  /* You can choose what columns */
run;

proc report data=sashelp.vcolumns nowd;
  columns _all_;
run;
dougcrites
Fluorite | Level 6

From what I understand, the DESCRIBE output always goes to the log, so I don't know any other way to direct it to a 'report'.  (I'm still quite new with SAS)..   The best I was able to do to retain this info, was to divert the log to a file.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Why do you need describe?  The two proc reports I gave you, SASHELP.VTABLE, SASHELP.VCOLUMN, contain the metadata of all the tables and columns - this is the SAS version of describe.  You can get the information directly from there.

dougcrites
Fluorite | Level 6

We could probably work with the table metadata like that... but for views,  the describe gives us the definition of the views which suits our purposes. I can't get that with a report of VVIEW.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

I think your likely stuck with the output the way it is then, unless you want to re-direct it into a datastep and process it that way.  

dougcrites
Fluorite | Level 6

OK, thanks for your quick responses. 

Tom
Super User Tom
Super User

It should work to change the LS option. Try this example.

data BURROWS( label='Isopod Burrow Locations and Covariates from an Israeli Desert' bufsize=65536 ) ;
 x=1;
run;

filename log1 temp ;

proc printto log=log1 new ; run;
proc sql ;
options ls=80 ;
  describe table work.burrows;
options ls=132 ;
  describe table work.burrows;
quit;
proc printto log=log ; run;
data _null_;
  infile log1 ;
  input;
  put _infile_;
run;

Results

1511  proc sql ;
1512  options ls=80 ;
1513    describe table work.burrows;
NOTE: SQL table WORK.BURROWS was created like:

create table WORK.BURROWS( label='Isopod Burrow Locations and Covariates from
an Israeli Desert' bufsize=65536 )
  (
   x num
  );

1514  options ls=132 ;
1515    describe table work.burrows;
NOTE: SQL table WORK.BURROWS was created like:

create table WORK.BURROWS( label='Isopod Burrow Locations and Covariates from an Israeli Desert' bufsize=65536 )
  (
   x num
  );

1516  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


1517  proc printto log=log ; run;
NOTE: 33 records were read from the infile LOG1.
dougcrites
Fluorite | Level 6

Tom, that worked!  Actually, I had tried setting the LS  option, but I did it higher in the program,  where it obviously did not affect this particular code.   Thank you!

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1916 views
  • 0 likes
  • 3 in conversation