Help using Base SAS procedures

Difference between table and listing

Reply
N/A
Posts: 0

Difference between table and listing

From the table shells given how do we know that we are making a table or a listing .Is there any diff between table and listings.i am really confused
Regular Contributor
Posts: 165

Re: Difference between table and listing

In clinical trials a table usually refers to something that has to be tabulated (Summary Statistics, frequencies, etc.) and listings are printouts of raw data ( i.e. a list of all adverse events).

Good luck!
SAS Super FREQ
Posts: 8,743

Re: Difference between table and listing

Hi:
I'm not sure what you mean by "table shells given". Otherwise, if you are talking about the difference between a SAS dataset and a SAS report listing, here goes. The short answer is yes, there is a difference between a TABLE and a "LISTING".

A SAS dataset is a proprietary file structure organized in a table structure of rows and columns. These are terms from data processing glossaries that show common terms and how they correspond to the terms most often used for a SAS dataset:
[pre]
Type of File Has: Composed of: Described by:
------------ ------------ ------------ -------------------------------
SAS dataset OBSERVATIONS VARIABLES SAS Dataset Descriptor Portion
TABLE ROWS COLUMNS RDBMS Data Dictionary
FILE RECORDS FIELDS File Record Layout
[/pre]

As you can see, the terms "observations" (or OBS) or "rows" are both describing the same component of a SAS dataset or SAS data table. Every SAS observation or row is composed of "variables" (or VARS) or COLUMNS. (The terms FILE/RECORDS/FIELDS are older terms used to describe data files.)

Mostly, the industry has settled on the TABLE/ROWS/COLUMNS as standard terminology -- due in large part to the popularity of Relational Data Base Systems (RDBMS). However, for SAS datasets, in particular, most SAS programmers use the terms DATASET and TABLE, OBSERVATIONS and ROWS, VARIABLES and COLUMNS interchangeably.

When you have a SAS dataset, you can create different outputs by using your SAS dataset with various SAS "canned" procedures (such as PROC FREQ, PROC MEANS, PROC PRINT, PROC REPORT, PROC GLM, etc). In the very, very old days, PROC PRINT output was called "LISTING" output -- because you used PROC PRINT to "list" every observation in your dataset. Your detailed listing of the observations would be in a report format -- with TITLES, FOOTNOTES, page numbering, with the report (or "LISTING" possibly grouped by BY variables) and possibly with a summary line added to the report for a summation of chosen numeric variables. The Enterprise Guide task for creating such a detailed report using PROC PRINT is called the "List Data Task".

A SAS dataset does not have a TITLE or a FOOTNOTE or summary lines. But, a REPORT on a SAS DATASET can have those things. When you use SAS Enterprise Guide your output is automatically created using the ODS destination of your choice (HTML, RTF, PDF). When you use the SAS Windowing Environment (also known as the interactive environment) your output goes by default to the Output Window (known in the "old" days as the LISTING Window).

The OUTPUT or LISTING window is a very plain, monospace font destination for reports -- it does not look very "modern", but when you add ODS statements to your code, you can route your procedure output to other file types (such as HTML, RTF, PDF, etc).

You asked specifically "how do we know that we are making a table or a listing"? You will have to look at your SAS code to answer that question. For example, if you see something like this:
[pre]
** 1) Create WORK.CLASS;
data work.class;
set sashelp.class;
age_in_5 = age + 5;
run;

** 2) Create WORK.CLASSF;
proc sql;
create table work.classF as
select * from sashelp.class
where sex = 'F';
quit;

** 3) Create WORK.AGESTATS;
proc means data=sashelp.class;
var age;
output out=work.agestats;
run;

** 4) Create Report on Above datasets;
ods html file='c:\temp\report_class.html' style=sasweb;
ods pdf file='c:\temp\report_class.pdf';
ods rtf file='c:\temp\report_class.rtf';
proc print data=work.class n;
title '1) Everybody in WORK.CLASS';
title2 'And their total weight';
sum weight;
run;

proc print data=work.classF n;
title '2) Everybody in WORK.CLASSF';
run;

proc print data=work.agestats;
title '3) Dataset created by PROC MEANS';
run;
ods _all_ close;
[/pre]

In the code above, #1, #2 and #3 examples are all creating SAS datasets -- note the use of the following statements:
DATA WORK.CLASS and
CREATE TABLE WORK.CLASSF and
OUTPUT OUT=WORK.AGESTATS -- they all indicate that a SAS dataset (or table) is being created.

Note also the use of the SET statement or the DATA= option -- that indicates that a dataset is being USED. So, for example:
SET SASHELP.CLASS indicates that the SASHELP.CLASS dataset is being used as INPUT to a program to create another SAS dataset.

The use of DATA=SASHELP.CLASS in PROC MEANS, on the other hand, indicates that SASHELP.CLASS is going to be USED by PROC MEANS to calculate some basic statistics (N, MIN, MEAN, STD, MAX) and create the dataset listed on the OUT=.

Compare examples 1-3 to example 4 -- which is just 3 PROC PRINT steps. A lot of folks would say that PROC PRINT creates LISTING output. I'd say that PROC PRINT is creating REPORT output. But either way, PROC PRINT is NOT creating any SAS datasets -- it is merely creating a report, where every row from the dataset is displayed and each PROC PRINT output will have a title and the first PROC PRINT output will have a summary line that sums all the weight values.

The ODS statements around the PROC PRINT steps tells me that 3 report files are being created: 1 HTML, 1 PDF and 1 RTF file -- and in the report files, I will see titles and page numbers (for the PDF and RTF files).

cynthia
N/A
Posts: 0

Re: Difference between table and listing

thank you Cynthia@sas and RickM
Ask a Question
Discussion stats
  • 3 replies
  • 4700 views
  • 0 likes
  • 3 in conversation