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

I've written a program that reads a files and creates multiple reports on a single PDF page.  It is macro driven, so that many separate report files can be generated at once.

 

This worked fine until I started to have the PDF file destination on a SharePoint site.  Now, instead of just writing each pdf, it opens Acrobat and asks me to respond to a prompt before it will generate the next PDF.  This would not be so bad if I were only generating a few PDFs, but with more than a hundred, responding to a prompt for each one gets old.  Thoughts?

 

The code and a screen print of the prompt are below:

 

/* clinic_report_printing.sas */

footnote;
footnote2;
footnote3;

option spool;

proc sort data=clinic_score4;by location;run;

*Options symbolgen mlogic nomprint nomfile bottommargin=.75in;

/* Macro to SCAN through DATALOG */
%MACRO SCANLOOP(SCANFILE,field1,field2);
/* First obtain the number of */
/* records in DATALOG         */
DATA _NULL_;
IF 0 THEN SET &SCANFILE NOBS=X;
CALL SYMPUT('RECCOUNT',X);
STOP;
RUN;
/* loop from one to number of */
/* records                    */
%DO I=1 %TO &RECCOUNT;
/* Advance to the Ith record */
DATA _NULL_;
SET &SCANFILE (FIRSTOBS=&I);
/* store the variables */
/* of interest in      */
/* macro variables     */
CALL SYMPUT('print_file',&field1);
CALL SYMPUT('location',&field2);
STOP;
RUN;
/* now perform the tasks that */
/* wish repeated for each     */
/* observation                */


ods listing close;

title &monthtext ' Productivity for '  &location ;

ods pdf file= &print_file;

options orientation=landscape papersize=letter linesize=200 nocenter;

ods graphics / reset=all scale  border=on;

/* report #1 */

ods escapechar = '^';

ods layout start;
proc sort data=clinic_score4;by location;run;

ods region x=.5in y=0in;

proc report data=clinic_score4 nowd split="*"
style(report)=[background=white cellspacing=2 borderwidth=1pt bordercolor=black foreground=black]
style(header)=[background=#E6E6E6]
style(column)=[cellspacing=2 borderwidth=1pt bordercolor=black]
;
where location=&location and month=&currmonth;

column ("This Month's Appointments"  allocated booked pct_book total_appts arrive npv_total bump cancel noshow  /*hrs_att svc_att*/);
define allocated / 'Hours Allocated' format=8. style(column)=[just=center background=lightyellow];
define booked  / 'Hours Booked' format=7. style(column)=[just=center background=lightyellow];
define pct_book / '% Hours Booked' format=percent7. style(column)=[just=center background=lightyellow];
define total_appts / '# Appts*Scheduled' f=6.0 style(column)=[just=center cellwidth=.8in background=lightyellow] ;
define arrive / '# Arrived*Appointments' format=8. style(column)=[just=center background=lightyellow];
define npv_total / '# NPV*Scheduled' f=6. style(column)=[ just=center cellwidth=.8in background=pink];
define cancel / '# Cancelled*Appointments' format=8. style(column)=[just=center background=#FFEBD6];
define noshow / '# No-Show*Appointments' format=8. style(column)=[just=center background=lightblue];
define bump / '# Bumped*Appointments' format=8. style(column)=[just=center background=#D4B8DC];
run;

ods region x=.5in y=1.5in;

proc report data=clinic_score4 nowd split='*'
style(report)=[background=white cellspacing=2 borderwidth=1pt bordercolor=black foreground=black]
style(header)=[background=#E6E6E6]
style(column)=[cellspacing=2 borderwidth=1pt bordercolor=black]
;
where location=&location and month=&currmonth;
column
("New Patient Visits"  pct_npv_7
pct_npv_14)
('Bumped Appts' pct_bmpd_rnd)
('Cancelled' pct_can_lt2)
('No-Shows'
pct_noshow
pct_fu_noshow
pct_npv_noshow_lt14
pct_npv_noshow_gt14)
;
define pct_npv_7/ '% NPV*Scheduled*<= 7 Days' f=percentn10. style(column)=[ just=center cellwidth=1in background=pink] ;

define pct_npv_14 / '% NPV*Scheduled*< 14 Days' f=percentn10. style(column)=[ just=center cellwidth=1in background=pink] ;
define pct_bmpd_rnd / '% of Scheduled*That Were*Bumped' f=percentn10. style(column)=[ just=center cellwidth=1.3in background=#D4B8DC] ;
define pct_noshow /'% of Scheduled*That Were*No-Shows' f=percentn10. style(column)=[just=center cellwidth=1.3in background=lightblue];
define pct_can_lt2 / '% of Scheduled*That Cancel*within 2 days' f=percentn10. style(column)=[just=center cellwidth=1.3in background=#FFEBD6] ;
define pct_fu_noshow / '% of Scheduled*F/U Visits*that No-Show' f=percentn10. style(column)=[cellwidth=1.3in just=center background=lightblue] ;
define pct_npv_noshow_lt14 / '% NPV*F/U Sched*<=14 Days' f=percentn10. style(column)=[cellwidth=1in just=center background=lightblue] ;
define pct_npv_noshow_gt14 / '% NPV*F/U Sched*>14 Days' f=percentn10. style(column)=[cellwidth=1in just=center background=lightblue] ;
;
run;

ods graphics on / imagemap=on;

proc sort data=clinic_score4;by location month;run;


ods region x=.5in y=3.25in height=3.25in width=4.25in;
title;

proc sgplot data=clinic_score4;
where location=&location and &bmonth <= month <= &emonth;
series x=month y=total_appts / legendlabel="Appts Scheduled" lineattrs=(color=blue) /* datalabel=a markers*/;
series x=month y=arrive / legendlabel="Appts Attended" lineattrs=(color=red) /*datalabel=p  markers*/ ;
series x=month y=cancel / legendlabel="Appts Cancelled" lineattrs=(color=green) /* datalabel=a markers*/;
series x=month y=noshow / legendlabel="Appts No-Showed" lineattrs=(color=black) /*datalabel=p  markers*/ ;

xaxis type=discrete label="Month";
yaxis label="Appointments" /* values=(0 to 150 by 10)*/;
run;

ods region x=5.5in y=3.25in height=3.25in width=4.25in;
title;

proc sgplot data=clinic_score4;
where location=&location and &bmonth <= month <= &emonth;
series x=month y=mean / legendlabel="Mean Days to Close Encounters" lineattrs=(color=red);
series x=month y=npv_sched_14 / legendlabel="NPV Scheduled w/in 14 Days" lineattrs=(color=purple) /* datalabel=a markers*/;
series x=month y=pct_npv_noshow_lt14 / legendlabel="NPV Follow-ups Scheduled w/in 14 Days that No-Show" lineattrs=(color=orange) /*datalabel=p  markers*/ ;
xaxis type=discrete label="Month";
yaxis label="Visits/Days" /* values=(0 to 150 by 10)*/;
run;


ods layout end;
ods pdf close;

%END;


%MEND SCANLOOP;

/* Call SCANLOOP */

%SCANLOOP(clinic_score4,print_file,m_loc);





sas_adobe_sharepoint.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Have you turned off View Results as they are generated option?

 

View solution in original post

4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
This web site https://forums.adobe.com/thread/987927 and this one https://social.technet.microsoft.com/Forums/office/en-US/00680e50-de5e-4d8c-b348-4ae9cecc3bad/pdf-do... implies that the behavior is between Adobe and Sharepoint -- not anything to do with SAS.

As a workaround, I would recommend writing to a non-sharepoint folder and then have some batch script copy from the non-sharepoint folder to the sharepoint location.

You might also want to check with Tech Support, but the web sites I found seem to imply that it is not a SAS issue.

cynthia
Reeza
Super User

Have you turned off View Results as they are generated option?

 

ljaeger
Fluorite | Level 6

IT WORKED!   I am putting you in my will!

Cynthia_sas
SAS Super FREQ
Ah, good call! I thought it was a Sharepoint error, not a SAS Open error.
cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1102 views
  • 2 likes
  • 3 in conversation