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:
Is there something I'm missing?
Thanks!
Keegan
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:
Is there something I'm missing?
Thanks!
Keegan
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:
Is there something I'm missing?
Thanks!
Keegan
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!
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.