@Cynthia_sas Hi, I am trying to use something analogous to #byval where in I want the text to appear as the header and not title. I am trying to follow the solution given by Cynthia here
https://communities.sas.com/t5/ODS-and-Base-Reporting/re-byval-in-header/td-p/316108
however _page_ is not resolved in my code and i cant achieve it.
proc report nowindows data=list_ae split='|' missing style(report)=[width=100% cellpadding=0]
style (column)=[protectspecialchars=off asis=on just=c] style(header)=[asis=on just=c];
by byvar;
column ("@R'\fs3\brdrb\brdrs\brdrw40" byvar pageit subjid age sex race aestdtc aeendtc aetext flag aeong_std) ;
define byvar / order order=internal noprint;
define pageit / order order=internal noprint;
define subjid/order order=internal noprint;
define aestdtc /display style(column)=[just=c width=10% rightmargin=1%] "AE Start Date";
define aeendtc /display style(column)=[just=c width=10%] "AE End Date";
define aetext /display style(column)=[just=c width=20%] "AE Body System Code/|AE Preferred Term/|Verbatim Term";
define aeong_std /display style(column)=[just=c width=8%] "Ongoing?";
*define aeterm /display style(column)=[just=c width=8%] "AE Verbatim Term";
define flag /display style(column)=[just=c width=8%] "Treatment Emergent|Serious|Dose Limiting Toxicity";
break after _page_/page;
compute before _page_ ;
pgstr=catx('\',subjid,age,sex,race);
line pgstr $varying100.;
endcomp;
run;
i get the following error
22759
22760 compute after pageit / style={just=l};
22761 line
22761! "____________________________________________________________________________________________________________________________
22761! ____________________";
22762 line "%str(Note: Treatment-Emergent Adverse Events is defined as any event that occurs on or after the first dose of
22762! study drug administration or any pre-existing event which worsened in severity after dosing.)";
22763 line "%str(Note: Coding used MedDRA version 23.0)";
22764 line "%str(Note: Safety Population = Subjects with at least one dose Dose groups represent subjects initial dose)";
22765 endcomp;
22766
22767 run;
ERROR: The BREAK variable _page_ is not one of the GROUP or
ORDER variables.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE REPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
22768
22769 ods rtf close;
22770 ods listing close;
22771
I also tried making an artificial pageit variable but i still dont get desired output. No error either.
Hi Cynthia,
ok lets start fresh. My objective is to produce a header (not title) which is repeated on every page. It is like #byvar, but I want to use compute block instead cause of the location it gets printed. I am using ODS RTF. I want to have it outputted at either of the 2 locations. this "pgstr that I want to print has subjid in it, so ofcourse I want a page break as it changes.
This is the code I am using
I first create a pageit variable like this,
data list_Ae2;
set list_ae;
by subjid;
pageit=ceil(divide(_n_,9));
run;
proc report nowindows data=list_ae2 split='|' missing style(report)=[width=100% cellpadding=0]
style (column)=[protectspecialchars=off asis=on just=c] style(header)=[asis=on just=c];
by subjid pageit;
column ("@R'\fs3\brdrb\brdrs\brdrw40" pageit subjid age sex race aestdtc aeendtc aetext flag aeong_std aerel) ;
define pageit / order page order=internal noprint;
define subjid/group page order order=internal noprint;
define age/group page order order=internal noprint;
define sex/group page order order=internal noprint;
define race/group page order order=internal noprint ;
define aestdtc /display style(column)=[just=c width=10% rightmargin=1%] "AE Start Date";
define aeendtc /display style(column)=[just=c width=10%] "AE End Date";
define aetext /display style(column)=[just=c width=20%] "AE Body System Code/|AE Preferred Term/|Verbatim Term";
define aeong_std /display style(column)=[just=c width=8%] "Ongoing?";
*define aeterm /display style(column)=[just=c width=8%] "AE Verbatim Term";
define flag /display style(column)=[just=c width=8%] "Treatment Emergent|Serious|Dose Limiting Toxicity";
break after pageit/page;
compute before pageit ;
pgstr=catx('\',subjid,age,sex,race);
line pgstr $varying100.;
endcomp;
compute after _page_ / style={just=l};
* line "________________________________________________________________________________________________________________________________________________";
line "%str(Note: Treatment-Emergent Adverse Events is defined as any event that occurs on or after the first dose of study drug administration or any pre-existing event which worsened in severity after dosing.)";
line "%str(Note: Coding used MedDRA version 23.0)";
line "%str(Note: Safety Population = Subjects with at least one dose Dose groups represent subjects initial dose)";
endcomp;
run;
I am not getting this pgstr getting printed at all.
thanks,
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.