BookmarkSubscribeRSS Feed
thanikondharish
Calcite | Level 5

data have ;

input id group$ ;

cards ;

101  group1

102 group1

103 group1

104 group2

105 group2

106 group2

;

1)Group1 has 88 files 

2)Group2 has 99 files

How to share files each group equally  like see below

 

101 group1 file1 

101 group1 file2

..................

106 group2 file99

3 REPLIES 3
noling
SAS Employee

Not exactly clear what you're asking. Please clarify your needs if this isn't helpful:

 

data want;
	length id 8. group file $10.;
	do id = 101 to 106;
		group = 'group1';
		do i= 1 to 88;
			 file=cats("file",i);
			 output;
		end;
		group = 'group2';
		do i = 1 to 99;
			file=cats("file",i);
			output;
		end;
	end;
	drop i;
run;

Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

thanikondharish
Calcite | Level 5
One office has 6 employees now we should give work to them they are total
36 files .Now we have distribute equally like see below
101 office1 file1
101 office1 file2
101 office1 file3
101 office1 file4
101 office1 file5
101 office1 file6
102 office1 file7
............
106 office1 file36
noling
SAS Employee

See if you can modify my previous datastep to get your desired output. Looks like this may need to be a separate table.

 

You should be able to use the mod function to find values that are divisible by 6 - http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245916.htm

 

 


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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