BookmarkSubscribeRSS Feed
OS2Rules
Obsidian | Level 7

Hi All:

I have a dataset that I run through a PROC TRANSPOSE so that data is across rather than down.

As a result of this the number of resulting variables could be 1 to who knows how many - even our client

can't pin down the number of permutations that this will generate.  (It is a reasonable number - most likely

less than 20).

Currently, the client report is generated with a PROC REPORT.   The data coming from the transpose

is to be merged onto the data currently on the client report.

Is there some way to tell the PROC REPORT to include VAR1 - VARx ?  Currently the PROC REPORT is

highly structured with define statements for each variable because the output uses ExcexXP.

Thanks in advance.

2 REPLIES 2
KarlK
Fluorite | Level 6

This is probably a little simple-minded for your purposes, but it does in fact work (9.3 TS1M2 on Win 7), assuming your variables out of Transpose are similarly-named.

data one;
input id x1 x2 x3;
datalines;
1 1 2 3
2 4 5 6
3 7 8 9
;;;;
run;

proc report data=one nowd;
columns id x:;
define id / order;
define x: / display;
title "Tester";
run;

HTH,

Karl

data_null__
Jade | Level 19

I've often wondered why the DEFINE statement supports the "SAS Variables List" but not the "List of SAS Variables". :smileygrin:

33         proc report data=one nowd;
34          columns id x1-x3;
35          define id / order;
36          define x1 x2 x3 / display;
                      __
                     
22
                     
202
ERROR
22-322: Syntax error, expecting one of the following: -, /, :. 
ERROR
202-322: The option or parameter is not recognized and will be ignored.
37          title "Tester";
38         run;

p.s. You folks that like a log checker take note those error messages don't begin "ERROR:" 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 748 views
  • 0 likes
  • 3 in conversation