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

Hi,

I am checking a code that outputs a pdf file and a ods printer, with some tables from proc tabulate and histograms.

 

The problem I get is that the output is displaying correctly on pdf file, but when i check printer output (I am using Microsoft XPS Document Writer to not waste paper) histograms doesnt appear but instead a question markCaptura.PNG is shown .

 

On warning I get these messages:

      WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not
      equal the area under a fitted curve.

 

And after that I get these errors:

     ERROR: Unable to set printer path per request.
     This is usually because the requested printer () is unknown.
     ERROR: Denegado el acceso para abrir el fichero: PS#I0000
     ERROR: Insufficient authorization to access C:\Windows\system32\sasprt.ps.
     ERROR: Physical file does not exist, D:\Users\.........\AppData\Local\Temp\SEG7392\SAS Temporary
     Files\_TD6556_C061561_\#LN01592.
     ERROR: Unable to load image FILEREF: PS#I0000; default image will be used instead.

 

Sadly, the person who was in charge of this project is not here anymore.

Thank you very much for reading

1 ACCEPTED SOLUTION

Accepted Solutions
Sk4r
Obsidian | Level 7

Solved, it was a problem about ods layout/ods region, I commented it and the histogram appeared on my output.

View solution in original post

8 REPLIES 8
ballardw
Super User

The warning about barwidth is not likely to be the problem.

 

You should show the log with the code as well as the errors as otherwise we are going to have potentially dozens of issues about the actual code submitted. Copy the section(s) needed from the log and paste into a code window opened on the forum with the {I} or "running man" icon.

 

Likely most of errors are created because of the first error. If the printer can't be established then everything related to that will fail.

 

We kind of need to see the actual code with the paths to make suggestions. The Log is telling use where something wasn't found but often is adding pieces to incomplete paths. If you specify a path without a drive at the root then the program will use a relative path and that may be somewhere you don't expect.

Sk4r
Obsidian | Level 7

 

%let rutasal=&txtCarpeta\&txtAno-&txtCiclo\&txtTipoPr\&txtNumEval\&txtArea-&txtGrupo\Salidas\Descriptivos, Histograma y Frecuencias de Puntajes Brutos &titTipoTema..pdf;
goptions reset=all; 
goptions device=png display;
options orientation=portrait linesize=256 pagesize=45;
options nonumber nodate copies=&txtCopias;
ods escapechar="^" USEGOPT ;
ODS PRINTER STYLE=CEPREPUC;
ods noproctitle;
ods pdf file = "&rutasal" style = Ceprepuc;
%principal(&txtTipoTema);
ods pdf close;
ods printer close;

 

%macro principal(txtTipoTema);
ods pdf startpage=now;
ods printer startpage=now;
%cabecera;
title7 J=C "&desAreaGrupo";
title8 J=C "&desTipoTema";
title9 J=C "DESCRIPTIVOS, HISTOGRAMA Y FRECUENCIAS DE PUNTAJES BRUTOS";
%pie_pdf;
ods layout start rows=3;
ods region;
%AlumnosxEstadoEval(&txtTipoTema);
/*usa el data set EvalxAluxTipTem*/
ods region;
%DescriptivosPtajesBrutos(&txtTipoTema);
ods region;
ods escapechar='^';
ods pdf text='^S={just=center font=("Arial",12PT,Bold)}HISTOGRAMA';
ods PRINTER text='^S={just=center font=("Arial",12PT,Bold)}HISTOGRAMA';
%HistogramaPtajesBrutos(&txtTipoTema);
ods layout end;
%FrecuenciasPtajesBrutos(&txtTipoTema);
%mend;
%macro HistogramaPtajesBrutos(txtTipoTema);
ods pdf startpage=never;
ods printer startpage=never;
goptions horigin=2 cm vorigin=3 hsize=15 cm vsize=12 cm ftext="arial" htext=8pt device=pdf;
proc univariate data= l1.EvalxAluxTipTem vardef=n noprint;

var puntbruto;
histogram puntbruto /normal(noprint) cfill=PAR font=arial novlabel barwidth=10 vscale=count midpoints=0 to 160 by 20;
where tipotema="&txtTipoTema";
footnote;
run;
%mend;
WARNING: Unsupported device 'PDFC' for TAGSETS.SASREPORT13(EGSR) destination. Using default device 'PNG'.
NOTE: Undefinable color PAR mapped to GRAY.
WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not 
equal the area under a fitted curve.
WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not 
equal the area under a fitted curve.
WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not 
equal the area under a fitted curve.
NOTE: 10816 bytes written to 
Sistema SAS

D:\Users\jklau\AppData\Local\Temp\SEG7392\SAS Temporary 
Files\_TD6556_C061561_\Prc2\univar27.png.
ERROR: Unable to set printer path per request. 
This is usually because the requested printer () is unknown.
ERROR: Denegado el acceso para abrir el fichero: PS#I0000
ERROR: Insufficient authorization to access C:\Windows\system32\sasprt.ps.
ERROR: Physical file does not exist, D:\Users\jklau\AppData\Local\Temp\SEG7392\SAS Temporary 
Files\_TD6556_C061561_\#LN02109.
ERROR: Unable to load image FILEREF:PS#I0000; default image will be used instead.
NOTE: PROCEDIMIENTO UNIVARIATE used (Total process time):
real time 0.39 seconds
cpu time 0.24 seconds

SYMBOLGEN: La macro variable TXTTIPOTEMA se resuelve en LC
SYMBOLGEN: La macro variable TXTANO se resuelve en 2016
SYMBOLGEN: La macro variable TXTCICLO se resuelve en 2
SYMBOLGEN: La macro variable TXTTIPOPR se resuelve en PR
SYMBOLGEN: La macro variable TXTNUMEVAL se resuelve en 2
SYMBOLGEN: La macro variable FDATE se resuelve en 07/22/19

The rest of the code is not affected and the output is correct, so I didnt posted it.

Thank you very much for your time

 

 

ballardw
Super User

I don't see any place that the Device is set to PDFC or the text of a call to the printer path that looks like it might be that 😧\Users\jklau\AppData\Local\Temp\SEG7392\SAS Temporary Files\_TD6556_C061561_\Prc2\univar27.png.

 

 

You might have something buried in your custom style CEPREPUC that we can't see.

 

Way too many macro variables that don't have provided values. You might consider using Options MPRINT as well as SYMBOLGEN to get a better look a the created code.

 

Reduce the code to 1) only the output you think is the problem (such as possibly the proc univariate), 2) without any macro references at all. Run just that code and see if you have the same problem. If so then show us that code and provide some example data.

 

Also, what environment are you running the code in? SAS Foundation, Enterprise Guide, University edition? Local machine or networked server?

Sk4r
Obsidian | Level 7

Thank you for your reply. I forgot I changed device value to pdfc (on the code was pdf).

About printer path, is selecting sysprint value (Microsoft XPS Document Writer).

 

I am running on Enterprise Guide on a local machine, and here is the custom style :

 

proc template;                                                                
   define style Styles.Ceprepuc;                                                 
      parent = styles.default; 
	  class fonts /                                                         	  	 
         'SASTitleFont' = ("Arial, Helvetica, Helv",12,Bold)          
         'TitleFont2' = ("Arial, Helvetica, Helv",12,Bold)            
         'TitleFont' = ("Arial, Helvetica, Helv",12,Bold)             
         'StrongFont' = ("Arial, Helvetica, Helv",2,Bold)            
         'EmphasisFont' = ("Arial, Helvetica, Helv",2)               
         'FixedEmphasisFont' = ("Arial, Courier",2)              
         'FixedStrongFont' = ("Arial, Courier",2,Bold)                  
         'FixedHeadingFont' = ("Arial, Courier",2,Bold)                 
         'FixedFont' = ("Arial, Courier",2)                             
         'headingEmphasisFont' = ("Arial, Helvetica, Helv",2,Bold)   
         'headingFont' = ("Arial",8pt,Bold)                  /*Cabecera de columnas*/
         'docFont' = ("Arial, Helvetica, Helv",1)
		 'footFont' = ("Arial", 8pt);
      class color_list /                                                    
         'fgB2' = cx000000                                                    
         'fgB1' = cx483320                                                    
         'fgB' = cx000000                                                     
         'bgB' = white                                                     
         'fgA5' = cxFFFF77                                                    
         'bgA5' = white                                                    
         'fgA4' = cxFFFF77                                                    
         'bgA4' = cx808080                                                    
         'fgA3' = cxFFFFFF                                                    
         'bgA3' = white                                                    
         'fgA2' = cxA80000                                                    
         'bgA2' = white                                                    
         'bgA1' = white                                                    
         'fgA' = cx000000                                                     
         'bgA' = white;                                                    
      class colors /                                                        
         'headerfgemph' = color_list('fgA')                                   
         'headerbgemph' = color_list('bgA')                                   
         'datafgemph' = color_list('fgA2')                                    
         'databgemph' = color_list('bgA1')                                    
         'headerfgstrong' = color_list('fgA')                                 
         'headerbgstrong' = color_list('bgA')                                 
         'datafgstrong' = color_list('fgA2')                                  
         'databgstrong' = color_list('bgA1')                                  
         'datafg' = color_list('fgA')                                         
         'databg' = color_list('bgA1')                                        
         'headerfg' = color_list('fgA')                                       
         'headerbg' = color_list('bgB')                                       
         'batchfg' = color_list('fgA')                                        
         'batchbg' = color_list('bgA1')                                       
         'tableborder' = color_list('fgA')                                    
         'tablebg' = color_list('bgA1')                                       
         'notefg' = color_list('fgA')                                         
         'notebg' = color_list('bgA')                                         
         'bylinefg' = color_list('fgA')                                       
         'bylinebg' = color_list('bgA1')                                      
         'captionfg' = color_list('fgA')                                      
         'captionbg' = color_list('bgA')                                      
         'proctitlefg' = color_list('fgA')                                    
         'proctitlebg' = color_list('bgA')                                    
         'titlefg' = color_list('fgA')                                        
         'titlebg' = color_list('bgA')                                        
         'systitlefg' = color_list('fgA')                                     
         'systitlebg' = color_list('bgA')                                     
         'Conentryfg' = color_list('fgB')                                     
         'Confolderfg' = color_list('fgB')                                    
         'Contitlefg' = color_list('fgB')                                     
         'link2' = color_list('fgB2')                                         
         'link1' = color_list('fgB1')                                         
         'contentfg' = color_list('fgB')                                      
         'contentbg' = color_list('bgB')                                      
         'docfg' = color_list('fgA')                                          
         'docbg' = color_list('bgA');                                         
      style Table from Table /                                                
         rules = all                                                          
         frame = Box                                                          
         cellspacing = 0                                                      
         cellpadding = 5;                                                     
      style Byline from Byline /                                              
         bordercolordark = color_list('bgA1')                                 
         bordercolorlight = color_list('fgA');                                
	  /*Títulos*/
	  style systemtitle from systemtitle/
	     font_face="Arial"
         font_size=10pt;
	  /*Pie de página*/
      style systemfooter from systemfooter/
         font_face="Arial"
         font_size=8pt;	
	  /*Para textos en gráficos*/
	  class GraphFonts "replace fonts used in graph" /
              'GraphDataFont' = ("Arial",8pt)
              'GraphValueFont' = ("Arial",8pt)
              'GraphLabelFont' = ("Arial",8pt,Bold)
              'GraphFootnoteFont' = ("Arial",8pt,Bold)
              'GraphTitleFont' = ("Arial",8pt);      
      class Data from Cell /                                                
         bordercolordark = color_list('bgA1')                                 
         bordercolorlight = color_list('bgB')                                 
         foreground = colors('datafg')                                        
         background = colors('databg');                                       
      class Header from HeadersAndFooters /                                 
         bordercolordark = color_list('bgA1')                                 
         bordercolorlight = color_list('fgA')
         ;
	class Body from Document                                              
         "Margenes de páginas" /                                          
         bottommargin = 1 cm                                                
         topmargin = 1 cm                                                   
         rightmargin = 1 cm                                                 
         leftmargin = 1 cm;   
    end;                                                                       
run;

The log shows this, three times, because I'm outputting three reports with the same content.

 

About 😧\Users\jklau\AppData\Local\Temp\SEG7392\SAS Temporary Files\_TD6556_C061561_\Prc2\univar27.png., the graph is storing with the name univar27.png  on that route, there are more images on that directory, dont know why.

 

Those macros references are for the pdf file path, that gets the output correctly, I dont use any macro variable for the histogram section, except one to filter values on the where condition.

 

WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not 
         equal the area under a fitted curve.
WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not 
         equal the area under a fitted curve.
WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not 
         equal the area under a fitted curve.

NOTE: 10816 bytes written to 
      D:\Users\jklau\AppData\Local\Temp\SEG7392\SAS Temporary 
      Files\_TD6556_C061561_\Prc2\univa102.png.

ERROR: Unable to set printer path per request. 
       This is usually because the requested printer () is unknown.

ERROR: Denegado el acceso para abrir el fichero: PS#I0000
ERROR: Insufficient authorization to access C:\Windows\system32\sasprt.ps.
ERROR: Physical file does not exist, D:\Users\jklau\AppData\Local\Temp\SEG7392\SAS Temporary 
       Files\_TD6556_C061561_\#LN07544.
ERROR: Unable to load image FILEREF:PS#I0000; default image will be used instead.
NOTE: PROCEDIMIENTO UNIVARIATE used (Total process time):
      real time           0.40 seconds
      cpu time            0.29 seconds
      

MPRINT(PRINCIPAL):  ;
MPRINT(PRINCIPAL):   ods layout end;
SYMBOLGEN:  La macro variable TXTTIPOTEMA se resuelve en LC
MPRINT(FRECUENCIASPTAJESBRUTOS):   ods pdf startpage=now;
MPRINT(FRECUENCIASPTAJESBRUTOS):   ods printer startpage=now;
MPRINT(CABECERA):   title2 j=l "PONTIFICIA UNIVERSIDAD CATÓLICA DEL PERÚ";
MPRINT(CABECERA):   title3 j=l "CENTRO PRE-UNIVERSITARIO";
SYMBOLGEN:  La macro variable TXTANO se resuelve en 2016
SYMBOLGEN:  La macro variable TXTCICLO se resuelve en 2
SYMBOLGEN:  La macro variable TXTTIPOPR se resuelve en PR
SYMBOLGEN:  La macro variable TXTNUMEVAL se resuelve en 2
MPRINT(CABECERA):   title4 j=l "PROCESO: 2016-2 EVAL.: PR-2";
MPRINT(FRECUENCIASPTAJESBRUTOS):  ;
MPRINT(FRECUENCIASPTAJESBRUTOS):   title7 j=c 'Tabla de frecuencia PUNTAJE BRUTO';
SYMBOLGEN:  La macro variable FDATE se resuelve en 07/22/19
MPRINT(PIE_PDF):   footnote1 J=L "Fecha: 07/22/19";
MPRINT(PIE_PDF):   footnote2 j=l "Página:^{thispage}";
MPRINT(FRECUENCIASPTAJESBRUTOS):  ;

 

 

 

Sk4r
Obsidian | Level 7

@ballardw I was checking on the log, and GPATH was set on that temp file path. Maybe it could be a hint. Thank you very much.

 

GPATH=&sasworklocation
SYMBOLGEN: La macro variable SASWORKLOCATION se resuelve en
"D:\Users\jklau\AppData\Local\Temp\SEG8384\SAS Temporary Files\_TD8940_C061561_\Prc2/"

 

ballardw
Super User

GPATH typically is only used by the ODS HTML destination so that you can direct graphic files to a destination other than the Path of the ODS destination.

 

Since you are mixing PDF and PRINTER output and apparently have HTML options involved plus all of the other macros it is very hard to diagnose things.

 

Have you tried extracting ONLY the part that should create the histogram as a small separate program and directing that output? That is a typical debugging exercise of only working on the problem piece until that works. Then incorporate other items, one section at a time. If the output quits working properly then the problem is related to the just added code.

Sk4r
Obsidian | Level 7

 

Thank you for your response, I just ran the code where it makes the histogram, I got the same problem the green blox with a question mark appears on the output to the printer, but the graph displays correctly on pdf file, the log (initial setting SAS does, and the section there the error shows) and code(principal calls HistogramaPtajesBrutos to generate histogram) is below:

 

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Reporte';
4          %LET _CLIENTPROJECTPATH='';
5          %LET _CLIENTPROJECTNAME='';
6          %LET _SASPROGRAMFILE=;
7          
8          ODS _ALL_ CLOSE;
9          OPTIONS DEV=ACTIVEX;
10         GOPTIONS XPIXELS=0 YPIXELS=0;
11         FILENAME EGSR TEMP;
12         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
13             STYLE=HtmlBlue
14             STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/Ht
14       ! mlBlue.css")
15             NOGTITLE
16             NOGFOOTNOTE
17             GPATH=&sasworklocation
18             ENCODING=UTF8
19             options(rolap="on")
20         ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
21         
22         GOPTIONS ACCESSIBLE;
.
.
.
.
.
NOTE: Writing ODS PDF output to DISK destination 
      "C:\p\ceprepuc\2016-2\PR\2\LE-NE\Salidas\Descriptivos, Histograma y Frecuencias de Puntajes 
      Brutos LECTURA.pdf", printer "PDF".
NOTE: This SAS session is using a registry in WORK.  All changes will be lost at the end of this 
      session.
NOTE: No units specified for the VORIGIN option.  INCHES will be used.
WARNING: Unsupported device 'PDFC' for TAGSETS.SASREPORT13(EGSR) destination. 
         Using default device 'PNG'.
NOTE: Undefinable color PAR mapped to GRAY.
WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not 
         equal the area under a fitted curve.
WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not 
         equal the area under a fitted curve.
WARNING: With BARWIDTH= or INTERBAR= specified, the total area of the histogram bars will not 
         equal the area under a fitted curve.
NOTE: This SAS session is using a registry in WORK.  All changes will be lost at the end of this 
      session.
NOTE: 10837 bytes written to 
                          Sistema SAS

      D:\Users\jklau\AppData\Local\Temp\SEG6492\SAS Temporary 
      Files\_TD5044_C061561_\Prc2\univar3.png.
ERROR: Unable to set printer path per request. 
       This is usually because the requested printer () is unknown.
ERROR: Denegado el acceso para abrir el fichero: PS#I0000
ERROR: Insufficient authorization to access C:\Windows\system32\sasprt.ps.
ERROR: Physical file does not exist, D:\Users\jklau\AppData\Local\Temp\SEG6492\SAS Temporary 
       Files\_TD5044_C061561_\#LN00298.
ERROR: Unable to load image FILEREF:PS#I0000; default image will be used instead.
%macro principal(txtTipoTema);
ods pdf startpage=now;
ods printer startpage=now;
%cabecera;
title7 J=C "&desAreaGrupo";
title8 J=C "&desTipoTema";
title9 J=C "DESCRIPTIVOS, HISTOGRAMA Y FRECUENCIAS DE PUNTAJES BRUTOS";
%pie_pdf;
ods layout start rows=3;
ods region;
%HistogramaPtajesBrutos(&txtTipoTema);
ods layout end;
%mend;

%macro HistogramaPtajesBrutos(txtTipoTema);
ods pdf startpage=never;
ods printer startpage=never;
goptions horigin=2 cm vorigin=3 hsize=15 cm vsize=12 cm ftext="arial" htext=8pt device=pdfc;
proc univariate data= l1.EvalxAluxTipTem vardef=n noprint;

var puntbruto;
histogram puntbruto /normal(noprint) cfill=PAR font=arial novlabel barwidth=10 vscale=count midpoints=0 to 160 by 20;
where tipotema="&txtTipoTema";
footnote;
run;
%mend;

%let rutasal=&txtCarpeta\&txtAno-&txtCiclo\&txtTipoPr\&txtNumEval\&txtArea-&txtGrupo\Salidas\Descriptivos, Histograma y Frecuencias de Puntajes Brutos &titTipoTema..pdf;

/*rutasal = C:\p\ceprepuc\2016-2\PR\2\LE-NE\Salidas\Descriptivos, Histograma y Frecuencias de Puntajes Brutos LECTURA.pdf, it's a folder I have created*/

goptions reset=all; 
goptions device=pdf display;
options orientation=portrait linesize=256 pagesize=45 papersize=("21 cm","29.7cm");
options nonumber nodate copies=&txtCopias;
ods escapechar="^" USEGOPT ;
ODS PRINTER STYLE=CEPREPUC;
ods noproctitle;
ods pdf file = "&rutasal" style = Ceprepuc;
%principal(LE);
ods pdf close;
ods printer close;

 

Sk4r
Obsidian | Level 7

Solved, it was a problem about ods layout/ods region, I commented it and the histogram appeared on my output.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 2759 views
  • 0 likes
  • 2 in conversation