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

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 1131 views
  • 0 likes
  • 2 in conversation