BookmarkSubscribeRSS Feed
raja777pharma
Fluorite | Level 6

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))

 

raja777pharma_0-1586433727510.png

 

But my out put is getting as per below ;

 

raja777pharma_1-1586433779232.png

 

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;
4 REPLIES 4
Jagadishkatam
Amethyst | Level 16

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;
Thanks,
Jag
raja777pharma
Fluorite | Level 6

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

raja777pharma_0-1586439400846.png

 

Jagadishkatam
Amethyst | Level 16

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;

Thanks,
Jag
raja777pharma
Fluorite | Level 6

Hello,

 

It's not  working as you mentioned i applied format but it didn't worked

 

raja777pharma_0-1586442525066.pngraja777pharma_1-1586442538400.png

 

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 4 replies
  • 1559 views
  • 0 likes
  • 2 in conversation