BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
rjronald
Fluorite | Level 6

I am in the process of transition from SAS Desktop (using the basic window for coding) to SAS Server with enterprise guide. During this transition I am have to ensure that regular reports can still be run with Server/EG. Below is sample code with fake data and values. When I run it on my desktop basic SAS it produces the output (Test_1) I want, but when I run on the SAS Server the PDF output (Test_2) does not properly map the colours, the output graph size is wrong, and the text is squished. Any help would be appreciated.

 

The report path is just the file location where I store the pdf.

 

Code:

DATA Profile_Color;
	LENGTH ID FillColor LineColor ContrastColor $ 10;
	INPUT ID &:$2. Value &:$50. FillColor &:$6. LineColor &:$6. ContrastColor &:$6.;
	DATALINES;
	DR  Missing  BIGB  BIGB  BIGB
	DR  Present  MOYG  MOYG  MOYG
	DR  Absent  LIPB  LIPB  LIPB

	;
RUN;

DATA Test;
	LENGTH Specialty Clinic wl_wk D_R $ 11;
	INPUT Specialty &:$11. Clinic &:$4. wl_wk &:$6. D_R &:$6. Count;
	DATALINES;
Hippo  Grey  1 wk  Missing  3
Hippo  Grey  1 wk  Present  4
Hippo  Grey  2 wks  Present  5
Hippo  Grey  3 wks  Absent  1
Hippo  Grey  4 wks  Present  3
Hippo  Grey  6 wks  Present  1
Hippo  Grey  8 wks  Missing  3
Hippo  Grey  8 wks  Present  6
Hippo  Grey  8 wks  Absent  2
Hippo  Grey  11 wks  Absent  5
	;
RUN;

ODS PDF FILE="&report_path.\Test_2 &today..pdf" STYLE=Styles.Orionbackground NOTOC DPI=300;
ODS GRAPHICS ON;
ODS GRAPHICS / WIDTH=6IN HEIGHT=3.5IN;
PROC SGPLOT DATA=Test DATTRMAP=Profile_Color;
	WHERE Specialty = 'Hippo' and Clinic = 'Grey';
	TITLE2 FONT=Albany 'Referral Waitlist';
	VBAR WL_WK/ Group=D_R RESPONSE=Count GROUPORDER=ASCENDING FILLTYPE=Solid ATTRID=DR;
	YAXIS LABEL='# of Visitors' LABELATTRS=(FAMILY=Albany) VALUEATTRS=(FAMILY=Albany);
	XAXIS TYPE=Discrete VALUES=('> 26 wks' '24-26 wks' '20-23 wks' '18-19 wks' '17 wks' '16 wks' '15 wks' '14 wks' 
									'13 wks' '12 wks' '11 wks' '10 wks' '9 wks' '8 wks' '7 wks' '6 wks' '5 wks' 
									'4 wks' '3 wks' '2 wks' '1 wks')
					LABELATTRS=(FAMILY=Albany) VALUEATTRS=(FAMILY=Albany) DISPLAY=(NOLABEL);
	KEYLEGEND / TITLE='' LOCATION=INSIDE POSITION=TOPLEFT TITLEATTRS=(FAMILY=Albany) VALUEATTRS=(FAMILY=Albany);
	XAXISTABLE Count/ LOCATION=INSIDE STAT=SUM VALUEATTRS=(FAMILY=Albany) LABELATTRS=(FAMILY=Albany WEIGHT=Bold);
RUN;

ODS PDF CLOSE;
1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Make sure the DATALINES lines are starting in column 1.

 

DATA Profile_Color;
	LENGTH ID FillColor LineColor ContrastColor $ 10;
	INPUT ID &:$2. Value &:$50. FillColor &:$6. LineColor &:$6. ContrastColor &:$6.;
	DATALINES;
DR  Missing  BIGB  BIGB  BIGB
DR  Present  MOYG  MOYG  MOYG
DR  Absent  LIPB  LIPB  LIPB
	;
RUN;
Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

View solution in original post

4 REPLIES 4
ChrisHemedinger
Community Manager

SAS Enterprise Guide will generate an ODS statement by default (likely ODS HTML5) with some settings that may affect your ODS PDF as well. To control for that, you can change the properties of your program to override default output (see this tip). Or try adding ODS CLOSE _ALL_ at the start of your code.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
rjronald
Fluorite | Level 6

Thanks! That helped with the text and size, however the color mapping is still not coming through. I get the following error message:

rjronald_0-1685037256947.png

 

ChrisHemedinger
Community Manager

Make sure the DATALINES lines are starting in column 1.

 

DATA Profile_Color;
	LENGTH ID FillColor LineColor ContrastColor $ 10;
	INPUT ID &:$2. Value &:$50. FillColor &:$6. LineColor &:$6. ContrastColor &:$6.;
	DATALINES;
DR  Missing  BIGB  BIGB  BIGB
DR  Present  MOYG  MOYG  MOYG
DR  Absent  LIPB  LIPB  LIPB
	;
RUN;
Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

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
  • 4 replies
  • 493 views
  • 2 likes
  • 2 in conversation