BookmarkSubscribeRSS Feed
ANKH1
Pyrite | Level 9

The table produced has many columns. Is there a way to display a pdf where the first 4 columns are repeated in all pages? There are many more columns after position and many more rows. I have the following code but it is not working:

data sample;
input ID $ Name $ Age Salary Department $ Position $;
datalines;
1 John 30 50000 HR Manager
2 Jane 25 55000 Finance Analyst
3 Jack 40 60000 IT Developer
4 Jill 35 62000 Marketing Specialist
;
run;

ods pdf file='C:\path\to\your\output.pdf';

proc report data=sample nowd split='_';
    column ID Name Age Salary Department Position;
    define ID / 'ID' left;
    define Name / 'Name' left;
    define Age / 'Age' center;
    define Salary / 'Salary' right;
    define Department / 'Department' left;
    define Position / 'Position' left;
    
    /* Specify the columns to be repeated */
    compute after _page_;
        line ' ';
        line 'ID     Name     Age     Salary';
    endcomp;
run;

/* Close ODS PDF destination */
ods pdf close;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 0 replies
  • 39 views
  • 0 likes
  • 1 in conversation