Is there a way to display variable name in the column, when the report is multi page and the column continues into next page. for eg. the report should display trt (type)in the listing at the begining and again when it crosses into next page.
Based on your previous postings, I figure that your question has to do with RTF and COMPUTE BEFORE _PAGE_ in PROC REPORT and whether you can repeat the value of a group variable at a page break. With the new measured RTF, in SAS 9.2, there may be way to do what you want. Otherwise, your best bet for help with this question is to contact Tech Support.
I think you misunderstood, I want both the variable label and the variable name as the column header. The variables in the MXG software have labels with '*' as split characters. Some files could have over 200 variables. When I want to pare down my report to include only the variables I want, it's a hassle going back to proc contents to get the variable name(s) and then putting together the report I want.
There are some automatic "dictionary" tables that are created in a SAS session that may help you. As long as you have your MXG librefs defined in a session, you should be able to programmatically get a list of variable names and their labels by running a PROC SQL against DICTIONARY.COLUMNS.
Here is an example of creating a data set from the dictionary tables...going after dictionary.columns for name and building a string that you could cut and paste into a label statement.
** make table to use later;
** cut and paste newlabel value into LABEL;
** statement or for reference;
create table work.paste as
trim(name)||'='||quote(trim(name)||'!'||trim(label)) as newlabel
where libname = "SASHELP" and
memname = "PRDSALE";
proc print data=work.paste noobs;
title 'data set from proc sql query on dictionary.columns';
title2 "for SASHELP.PRDSALE";
The output from the PROC PRINT would be:
data set from proc sql query on dictionary.columns
ACTUAL ACTUAL="ACTUAL!Actual Sales"
PREDICT PREDICT="PREDICT!Predicted Sales"
PRODTYPE PRODTYPE="PRODTYPE!Product type"
In this example, I set the split character to ! so you'd put split='!' in your PROC PRINT when you cut and pasted these label strings into your code. If you wanted to keep * as the split character, then you'd replace the ! with * in the SQL query. Then your split option in PROC PRINT would be split='*'.
There are many macro solutions you could build using the dictionary tables.