BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have following data
week dt1 dt2 ID day value
0 --
0 --
0 --
1
1
2
2
3
like this I have around 15 weeks and each week has data for more than one lab day for which dt1 and dt2 are unique. All together there are around 300 obs.
I have written the following code
proc report data=sample nowd;
columns (week day) id, (dt1 d2t val);
define id/across order=data 'Patient Id' spacing=1;
define week/group "Week" width=10;
define day/group "Day" nozero width=10 ' ';
define dt1/group 'Date1' width=10 spacing=1;
define dt2/group 'Date2' width=10 spacing=1;
define val/group " ";
run;

I am getting the data on multiple pages divided vertically . for example first four IDs data is coming on the first page in the following format
Id
week day dt1 dt2 val

but in the second page the columns week and day are not displayed as follows
ID
dt1 dt2 val

I want the columns week, day to be displayed on each page. please help me. I have to do this using proc report only.
1 REPLY 1
Tim_SAS
Barite | Level 11
Use the ID option on the DEFINE statement for DAY. This tells REPORT to put the DAY column and all the columns to the left of DAY on each page of the report. See http://support.sas.com/documentation/cdl/en/proc/59565/HTML/default/a002473627.htm#a003072099.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 1812 views
  • 0 likes
  • 2 in conversation