BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10
data t ;
array v(100) x1-x100;
do i=1 to 100	;
stop;
output;
drop i; end;
run;

How many ways to create 100 variables at a time in a single data step

and how many variables we can sort  is there any limit to sort 

1 REPLY 1
mkeintz
PROC Star

I don't know what the upper limit is for number of sort keys for PROC SORT, but I'm sure it can accommodate 100.  I'm also sure it would be slow.

 

Have you tested your data step code?  It has a STOP in the middle of a do loop, which otherwise would produce 100 observations of 100 variables, each defaulting to a missing value.  As it is you will produce a data set of zero observations, with 100 variables.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 604 views
  • 0 likes
  • 2 in conversation