08-13-2015 07:06 AM
I have some data, lets say three observations:
ID firstname lastname bdate residence sex score1 score2 score3 newdate
001 James Jones 24Aug1986 Urban M 200 458 1.25 05May2012
002 Suzie Smith 10Mar1982 Rural F . 1285 0.86 04Feb2015
003 Henry Marks 01Jun1972 Rural M 246 324 2.06 24Sep2014
I would like to produce output that will show the data transposed, and display a report, one observation per page.
In addition, I would like to display column heading and add comment fields. As an example for obs 1.:
Variable Name Value Comment1 Comment2 Comment3
then a second page would display Suzie Smith's data (obs 2), etc.The comment fields are place holders for comments to be completed late.
I wonder if the transposition can be accomplished in proc transpose or SQL. Then an output file using proc report.
Thanks for you help community.
08-17-2015 03:45 AM
You need to divide your process into few steps.
Step 1: Use proc transpose to transpose your data
Step 2: Use data step to define new columns (variables) comment1, comment2, comment3
Step 3: Use proc print (or any other, as you wish) to create report and by statement (by ID) to have your report grouped by ID (every new ID will show on the separate page). To use by instruction you need to first sort data by ID (proc sort)