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?
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!
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;
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.
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.
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.
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.
OK, thanks for your quick responses.
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.
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!
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.