BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jawhitmire
Quartz | Level 8

Good day.

I am operating with version 9.04 and without SAS/STATS.

The following source code:

data work.Metal_Conc (keep=Element Concentration Lab_SampleID);
				set all;
				first_numterm=(Conc_Flush*&UI_CRV2MFPV_TransVol_Meas.);
				second_numterm=((10**6)/fi)*COL1;
				third_numterm=6712*heel_conc;
				denominator=6712+&UI_CRV2MFPV_TransVol_Meas.;
				Concentration=(first_numterm+second_numterm+third_numterm)/denominator;
				Lab_SampleID= 'L000'||_n_ ;
		run;

results in output:

 

Element Concentration Lab_SampleID 
Al 38687.24 L000 1 
B 49763.01 L000 2 
Ca 23036.29 L000 3 
Cl 37280.94 L000 4 
Fe 17333.57 L000 5 
Li 8598.14 L000 6 
Mg 4770.01 L000 7 
Na 350033.08 L000 8 
S 5849.44 L000 9 
Si 145292.48 L000 10 
Ti 15622.81 L000 11 
Zn 10333.94 L000 12 
Zr 8970.83 L000 13 

I would like to remove the space in Lab_SampleID

 

 

Thank you,

 

Jane

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

try

 

	Lab_SampleID=cats( 'L000',_n_) ;

View solution in original post

1 REPLY 1
novinosrin
Tourmaline | Level 20

try

 

	Lab_SampleID=cats( 'L000',_n_) ;
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
  • 1 reply
  • 849 views
  • 1 like
  • 2 in conversation