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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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