Learning SAS? Welcome to the exclusive online community for all SAS learners.

Does anybody know how to display Listing output in SAS Studio?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

Does anybody know how to display Listing output in SAS Studio?

I'm studying for the SAS Base Certification Exam. One question that has come up for me is how to display the output in 'Results' as Listing. I was able to do this with SAS OnDemand with no issues because it used SAS Enterprise Guide 6. Please let me know whether or not it is possible to display Listing output in SAS Studio. I would appreciate any replies, thank you.


Accepted Solutions
Solution
‎12-13-2014 04:45 PM
Super User
Posts: 19,861

Re: Does anybody know how to display Listing output in SAS Studio?

I think your text editor may be mangling the output.  Try using something like Notepad++ or TextWrangler.

The default behaviour is the upper right hand corner and that's how it appears to me in the output you attached. 

If you want something else you need to go the route Tom suggested.

View solution in original post


All Replies
Super User
Posts: 19,861

Re: Does anybody know how to display Listing output in SAS Studio?

I don't think you can.

If you can, it would be via:

ods listing;

i also don't see how the destination would affect your studyng.

Occasional Contributor
Posts: 11

Re: Does anybody know how to display Listing output in SAS Studio?

Thank you for your response. The reason why this issue affects my studying is because two chapters of the preparation guide explain how SAS statements can be used to modify Listing output. I thought it would be better if I can run the sample code from the book myself to generate results with Listing output as intended.

Super User
Posts: 19,861

Re: Does anybody know how to display Listing output in SAS Studio?

I don't have the book handy, its at the office but post a sample.

I'm not sure the destination matters.

Occasional Contributor
Posts: 11

Re: Does anybody know how to display Listing output in SAS Studio?

Thank you for all the help on this issue so far!

The code that I was trying to use in SAS Studio for the LISTING output is the following:

ODS LISTING;

OPTIONS NONUMBER NODATE;


PROC PRINT DATA=BASECERT.ADMIT;

  VAR ID SEX AGE HEIGHT WEIGHT;

  WHERE AGE>=30;

RUN;


OPTIONS DATE;

PROC FREQ DATA=BASECERT.DIABETES;

  where FASTGLUC >=300;

  TABLES SEX;

RUN;

PROC PRINT DATA=BASECERT.DIABETES;

RUN;

ODS LISTING CLOSE;

Super User
Posts: 19,861

Re: Does anybody know how to display Listing output in SAS Studio?

Apparently you can generate the file and then open it in a text editor to see the output.

A bit useful for learning Smiley Happy

ODS LISTING file='/folders/myfolders/sample.lst';

OPTIONS NONUMBER NODATE;

PROC PRINT DATA=SASHELP.HEART(OBS=10);

  VAR SEX HEIGHT WEIGHT;

RUN;

OPTIONS DATE;

PROC FREQ DATA=SASHELP.HEART(OBS=100);

  TABLES SEX;

RUN;

PROC PRINT DATA=SASHELP.CLASS;

RUN;

ODS LISTING CLOSE;

Occasional Contributor
Posts: 11

Re: Does anybody know how to display Listing output in SAS Studio?

Thank you Reeza for providing me with another helpful response. The Listing output was generated as intended in a '.lst' file, but the output  is 'centred' in a way that the dates for the output appear on two sides of the page instead of being aligned to the left. Would you know a way to allow the output to be entirely left-aligned? I have tried to attach a copy of the '.lst' output, but don't know if that has worked.

Attachment
Super User
Super User
Posts: 7,076

Re: Does anybody know how to display Listing output in SAS Studio?

Did you try changing the setting of the CENTER option?

options nocenter;

Occasional Contributor
Posts: 11

Re: Does anybody know how to display Listing output in SAS Studio?

Thanks for the prompt reply. The Listing output itself is centered, but the date values are splintered across the page.  I tried attaching the centered Listing output to this reply, it's called 'Listing_Output2.lst'.

Attachment
Super User
Super User
Posts: 7,076

Re: Does anybody know how to display Listing output in SAS Studio?

If you do not what the DATE displayed on the upper right hand corner of the page then turn it off an generate your own title with the date where you want it.

options nodate ;

title1 "Rundate: &sysdate9 Runtime : &systime"

Solution
‎12-13-2014 04:45 PM
Super User
Posts: 19,861

Re: Does anybody know how to display Listing output in SAS Studio?

I think your text editor may be mangling the output.  Try using something like Notepad++ or TextWrangler.

The default behaviour is the upper right hand corner and that's how it appears to me in the output you attached. 

If you want something else you need to go the route Tom suggested.

Occasional Contributor
Posts: 11

Re: Does anybody know how to display Listing output in SAS Studio?

I opened the 'LIST_OUTPUT2.lst' file in a text editor using a Mac application and the output looked fine with the contents all right-aligned and legible. Thanks again.

🔒 This topic is solved and locked.

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

Discussion stats
  • 11 replies
  • 1209 views
  • 8 likes
  • 3 in conversation