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
Diamond | Level 26

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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 2257 views
  • 0 likes
  • 2 in conversation