BookmarkSubscribeRSS Feed
thanikondharish
Fluorite | Level 6

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
Fluorite | Level 6
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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 832 views
  • 0 likes
  • 2 in conversation