Hello Team,
I would like to display one var value in each RTF page starting after one line blank line,
I would like show as per below screen shot on every page value is (Body Weight (kg))
But my out put is getting as per below ;
I am using below code:
Note: The each page display value var is "param" .
proc Report data=report split='^' missing nowd spanrows headline headskip ;
column gpxpage paramn param avisitn col1 gpx2 col2 col3 col4 col5 col6 col7 ;
define gpxpage /order order=internal "" noprint;
define paramn /group noprint;
define param /group noprint;
define avisitn /group noprint;
define gpx2 /group noprint;
define col1 /&Header. order order=internal style(column)=[cellwidth=2.in font_face=&fontf font_size=&fontsz just=l asis=on] style(hdr)=[just=l asis=on] flow;
define col2 /"Parameter" order order=data style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=l asis=on] style(hdr)=[just=l asis=on] flow;
define col3 /"Statistics" order order=data style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=l asis=on] style(hdr)=[just=l asis=on] flow;
define col4 /&Header1. order style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=c asis=on] style(hdr)=[just=c asis=on];
define col5 /&Header2. order style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=c asis=on] style(hdr)=[just=c asis=on];
define col6 /&Header3. order style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=c asis=on] style(hdr)=[just=c asis=on];
define col7 /&Header7. order style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=c asis=on] style(hdr)=[just=c asis=on];
break after gpxpage / page;
compute before gpxpage;
line " ";
endcomp;
compute after gpx2;
line " ";
endcomp;
compute before _PAGE_ / left;
length text1 $100;
if _BREAK_=' ' then do;
text1="^{style[font_face=&fontf font_size=&fontsz}"||strip(param);
end;
line text1 $100.;
endcomp;
run;
I updated the code as below, please try
compute before gpxpage;
line @3 param;
endcomp;
proc Report data=report split='^' missing nowd spanrows headline headskip ;
column gpxpage paramn param avisitn col1 gpx2 col2 col3 col4 col5 col6 col7 ;
define gpxpage /order order=internal "" noprint;
define paramn /group noprint;
define param /group noprint;
define avisitn /group noprint;
define gpx2 /group noprint;
define col1 /&Header. order order=internal style(column)=[cellwidth=2.in font_face=&fontf font_size=&fontsz just=l asis=on] style(hdr)=[just=l asis=on] flow;
define col2 /"Parameter" order order=data style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=l asis=on] style(hdr)=[just=l asis=on] flow;
define col3 /"Statistics" order order=data style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=l asis=on] style(hdr)=[just=l asis=on] flow;
define col4 /&Header1. order style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=c asis=on] style(hdr)=[just=c asis=on];
define col5 /&Header2. order style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=c asis=on] style(hdr)=[just=c asis=on];
define col6 /&Header3. order style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=c asis=on] style(hdr)=[just=c asis=on];
define col7 /&Header7. order style(column)=[cellwidth=1in font_face=&fontf font_size=&fontsz just=c asis=on] style(hdr)=[just=c asis=on];
break after gpxpage / page;
compute before gpxpage;
line @3 param;
endcomp;
compute after gpx2;
line " ";
endcomp;
run;
Hello ,
it's not working and showing error as below
ERROR: PARAM must use a character format.
ERROR: PARAM must use a character format.
ERROR: PARAM must use a character format.
ERROR: PARAM must use a character format.
ERROR: PARAM must use a character format.
ERROR: PARAM must use a character format.
My data is like below
do you have any character format for param that you can use
you need to create a format for param and use that as $sample.
Something like
proc format ;
value sample
'Body Weight (kg)'='Body Weight (kg)';
run;
compute before gpxpage;
line @3 param $sample.;
endcomp;
Hello,
It's not working as you mentioned i applied format but it didn't worked
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.