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

I'm trying to print my proc freq data output to a .png file for future use. 

 

This is my code:

options printerpath=png nodate papersize=('5.75in','4.75in');
ods _all_ close;
ods printer file="X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display";

proc freq data=active; table congestion_Zone; run;

ods printer close;

ods listing;

This is my error in the log:

186   options printerpath=png nodate papersize=('5.75in','4.75in');
187  ods _all_ close;
188  ods printer file="X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic
188! Display";
NOTE: Writing ODS PRINTER output to DISK destination
      "X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display",
      printer "png".
189
190   proc freq data=active; tables enrollment_type; run;

NOTE: There were 223584 observations read from the data set WORK.ACTIVE.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           3.83 seconds
      cpu time            3.37 seconds


191
192  ods printer close;
ERROR: Invalid file, X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display.
193
194  ods listing;

The proc freq output by itself would look like this:

Keegan_0-1634155732127.png

Is there something I'm missing?

 

Thanks!

Keegan

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

I think files should have an extension? I'm also surprised to see a path with exclamation marks. Is that actually in your file name?

 

ods printer file="X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display\myFile.png";

@Keegan wrote:

I'm trying to print my proc freq data output to a .png file for future use. 

 

This is my code:

options printerpath=png nodate papersize=('5.75in','4.75in');
ods _all_ close;
ods printer file="X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display";

proc freq data=active; table congestion_Zone; run;

ods printer close;

ods listing;

This is my error in the log:

186   options printerpath=png nodate papersize=('5.75in','4.75in');
187  ods _all_ close;
188  ods printer file="X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic
188! Display";
NOTE: Writing ODS PRINTER output to DISK destination
      "X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display",
      printer "png".
189
190   proc freq data=active; tables enrollment_type; run;

NOTE: There were 223584 observations read from the data set WORK.ACTIVE.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           3.83 seconds
      cpu time            3.37 seconds


191
192  ods printer close;
ERROR: Invalid file, X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display.
193
194  ods listing;

The proc freq output by itself would look like this:

Keegan_0-1634155732127.png

Is there something I'm missing?

 

Thanks!

Keegan


 

View solution in original post

3 REPLIES 3
Reeza
Super User

I think files should have an extension? I'm also surprised to see a path with exclamation marks. Is that actually in your file name?

 

ods printer file="X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display\myFile.png";

@Keegan wrote:

I'm trying to print my proc freq data output to a .png file for future use. 

 

This is my code:

options printerpath=png nodate papersize=('5.75in','4.75in');
ods _all_ close;
ods printer file="X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display";

proc freq data=active; table congestion_Zone; run;

ods printer close;

ods listing;

This is my error in the log:

186   options printerpath=png nodate papersize=('5.75in','4.75in');
187  ods _all_ close;
188  ods printer file="X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic
188! Display";
NOTE: Writing ODS PRINTER output to DISK destination
      "X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display",
      printer "png".
189
190   proc freq data=active; tables enrollment_type; run;

NOTE: There were 223584 observations read from the data set WORK.ACTIVE.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           3.83 seconds
      cpu time            3.37 seconds


191
192  ods printer close;
ERROR: Invalid file, X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display.
193
194  ods listing;

The proc freq output by itself would look like this:

Keegan_0-1634155732127.png

Is there something I'm missing?

 

Thanks!

Keegan


 

Keegan
Obsidian | Level 7

That was it! I just needed to add the file name in the extension. 

And yes, our folder location for our group has those punctuation marks to make it appear at the top of a long list of folders for other groups. 

 

Thank you for your help!

SASKiwi
PROC Star

Are you using a remote SAS server by any chance as SAS is saying this is an invalid file path: X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 3 replies
  • 533 views
  • 0 likes
  • 3 in conversation