BookmarkSubscribeRSS Feed
lisahoward
Calcite | Level 5

I am trying to output to the following proc report to a  PDF file using the following code.  However my narrative variable  gets truncated if it is longer than one PDF page. One page is fine but if it spans over two pages it is truncated at the end of the first page. Does anyone have any help on how to stop the truncation of the narrative field.

Many thanks.


proc report data=patient headline headskip split='\' nowd;

where casenumber=&casenum;

column casenumber narrative comment_text abbrev_narrative seriousness_desc serious_notes causality

    agent_notes listedness listedness_notes outcome_desc;

define casenumber / order id noprint;

define narrative / display  width=50 'Narrative' flow;

define comment_text / display  width=50  Analysis Statement' flow;

define abbrev_narrative / display  width=40 Comment' flow page;

define seriousness_desc         / display  width=20 'Case Seriousness';

define serious_notes         / display  width=20 'Notes' flow;

define causality     / display  width=10 'Case Causality';

define agent_notes     / display  width=20 'Notes' flow;

define listedness     / display  width=14 'Listedness Determination';

define listedness_notes / display  width=20 'Notes' flow;

define outcome_desc / display  width=20 'Case Outcome' page;

compute before _page_;

line @3 'CASE ASSESSMENT';

line @4 ' ';

endcomp;

ods pdf startpage=now;

%macro loop(list=);

%if %sysfunc(exist(work.check1)) %then %do;

%* Initialize loop;

%let i=1;

%let casei=%scan(&list,&i,str(,));

%* Run loop;

%do %while (&casei ne);

dm 'odsresults; clear';

ods listing close;

options papersize=a4 leftmargin=3.5 cm rightmargin=3.5 cm;

ods pdf file = "C:\temp\CaseNumber &casei..pdf" style = sasweb;

ods escapechar='~';

footnote1 j=c 'Page ~{thispage} of ~{lastpage} ';

footnote2 j=r 'Report Generated on ' &sysdate9;

ods pdf startpage=no;

%* Do processing for this iteration of the loop;

   %put PROCESSING CASE NUMBER &casei;

   %casereport(casenum=&casei);

   %* Prepare for next iteration of the loop;

   %let i=%eval(&i+1);

   %let casei=%scan(&list,&i,str(,));

ods pdf close;

ods listing;

%end;

%end;

%else %do;

%display logonerror;

%end;

dm 'odsresults; clear';

%mend loop;

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

Without data, or the full program, it is very hard to make a constructive comment. If truncation is occuring, it is related to the actual data using your actual program. It might be to your benefit to contact Tech Support and open a track. They could look at ALL of your program and use it with your data in order to help you debug your issue.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 1677 views
  • 0 likes
  • 2 in conversation