Hi all,

I have a database as the following:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str4(atc3n atc3) str93 atc_description
"A01A" "A1A" "Stomatologicals"                                                                              
"A01B" "A1B" "Mouth Antifungals"                                                                            
"A02B" "A2B" "Acid Pump Inhibitors"                                                                         
"A02B" "A2B" "All Other Antiulcerants"                                                                      
"A02B" "A2B" "Bismuth Antiulcerants"                                                                        
"A02B" "A2B" "H2 Antagonists"                                                                               
"A02B" "A2B" "Prostaglandin Antiulcerants"                                                                  
"A03A" "A3A" "Plain Antispasmodics And Anticholinergics"                                                    
"A3F"  "A3F" "Gastroprokinetics"                                                                            
"A3G"  "A3G" "Gastro-intestinal Sensorimotor Modulators"                                                    
"A4A"  "A4A" "Other Antiemetics And Antinauseants"                                                          
"A4A"  "A4A" "Serotonin Antagonist Antiemetics/Antinauseants"                                               
"A5A"  "A5A" "Bile Therapy And Cholagogues"                                                                 
"A5B"  "A5B" "Hepatic Protectors"                                                                           
"A6A"  "A6A" "Osmotic Laxatives"                                                                            
"A6A"  "A6A" "Other Drugs For Constipation"                                                                 
"A6A"  "A6A" "Stimulant Laxatives"                                                                          
"A7A"  "A7A" "Intestinal Anti-infective Antidiarrhoeals"                                                    
"A7B"  "A7B" "Intestinal Adsorbent Antidiarrhoeals"                                                         
"A7E"  "A7E" "Intestinal Anti-inflammatory Agents"                                                          
"A7F"  "A7F" "Antidiarrhoeal Micro-organisms"                                                               
"A7H"  "A7H" "Motility Inhibitors"                                                                          
"A7X"  "A7X" "All Other Antidiarrhoeals"                                                                    
"A8A"  "A8A" "Antiobesity Preparations"                                                                     
"A9A"  "A9A" "Digestives"                                                                                   
"B1A"  "B1A" "Vitamin K Antagonists"                                                                        
"B1B"  "B1B" "Fractionated Heparins"                                                                        
"B1B"  "B1B" "Other Heparins"                                                                               
"B1B"  "B1B" "Unfractionated Heparins"                                                                      
"B1C"  "B1C" "ADP (Adenosine Diphosphate) Receptor Antagonist Platelet Aggregation Inhibitors"              
"B1C"  "B1C" "Cyclo-oxgenase Inhibitor Platelet Aggregation Inhibitors"                                     
"B1C"  "B1C" "GP IIb/IIIa (Glycoprotein) Antagonist Platelet Aggregation Inhibitors"                        
"B1C"  "B1C" "Other Platelet Aggregation Inhibitors"                                                        
"B1C"  "B1C" "Platelet Aggregation Inhibitors"                                                              
"B1C"  "B1C" "Platelet CAMP Enhancing Platelet Aggregation Inhibitors"                                      
"B1D"  "B1D" "Fibrinolytics"                                                                                
"B1E"  "B1E" "Direct Thrombin Inhibitors"                                                                   
"B1F"  "B1F" "Direct Factor Xa Inhibitors"                                                                  
"B1X"  "B1X" "Other Antithrombotic Agents"                                                                  
"B2A"  "B2A" "Other Antifibrinolytics"                                                                      
"B2A"  "B2A" "Synthetics Antifibrinolytics"                                                                 
"B2B"  "B2B" "Antagonists (Antidotes To Anticoagulants)"                                                    
"B2C"  "B2C" "Coagulation Inhibitors"                                                                       
"B2C"  "B2C" "Inhibitors Of Fibrinolysis"                                                                   
"B2C"  "B2C" "Inhibitors Of The Kallikrein-kinin-system"                                                    
"B2C"  "B2C" "Other Proteinase Inhibitors"                                                                  
"B2D"  "B2D" "Anti-inhibitor-coagulation Complex"                                                           
"B2D"  "B2D" "Factor VIII"                                                                                  
"B2D"  "B2D" "Factor XIII"                                                                                  
"B2D"  "B2D" "Factors II, VII, IX and X"                                                                    
"B2D"  "B2D" "Fibrinogen"                                                                                   
"B2D"  "B2D" "Other Blood Fractions"                                                                        
"B2E"  "B2E" "Thrombopoietin Agonists"                                                                      
"B2F"  "B2F" "Tissue Sealing Preparations"                                                                  
"B2G"  "B2G" "Systemic Haemostatics"                                                                        
"B3A"  "B3A" "Haematinics"                                                                                  
"B3C"  "B3C" "Erythropoietin Products"                                                                      
"B3X"  "B3X" "Other Anti-anaemic Products"                                                                  
"B6B"  "B6B" "Hyaluronidase"                                                                                
"B6C"  "B6C" "Other Haematological Agents"                                                                  
"C1A"  "C1A" "Plain Cardiac Glycosides"                                                                     
"C1B"  "C1B" "Anti-arrhythmics"                                                                             
"C1C"  "C1C" "Cardiac Dopaminergic Agents"                                                                  
"C1C"  "C1C" "Cardiac Stimulants Excluding Dopaminergic Agents"                                             
"C1D"  "C1D" "Coronary Therapy Excluding Calcium Antagonists And Nitrites"                                  
"C1E"  "C1E" "Nitrites And Nitrates"                                                                        
"C1F"  "C1F" "Positive Inotropic Agents"                                                                    
"C1X"  "C1X" "All Other Cardiac Preparations"                                                               
"C2A"  "C2A" "Antihypertensives (Of Non-herbal Origin) Plain"                                               
"C2B"  "C2B" "Antihypertensives (Of Non-herbal Origin)"                                                     
"C3A"  "C3A" "Loop Diuretics Plain"                                                                         
"C3A"  "C3A" "Other Diuretics"                                                                              
"C3A"  "C3A" "Potassium-sparing Agents Plain"                                                               
"C3A"  "C3A" "Thiazides And Analogues Plain"                                                                
"C3A"  "C3A" "Vasopressin Receptor Antagonist Diuretics"                                                    
"C4A"  "C4A" "Calcium Antagonists With Cerebral Activity"                                                   
"C4A"  "C4A" "Cerebral And Peripheral Vasotherapeutics Excluding Calcium Antagonists With Cerebral Activity"
"C5A"  "C5A" "Topical Anti-haemorrhoidals"                                                                  
"C5C"  "C5C" "Varicose Therapy"                                                                             
"C6A"  "C6A" "Other Cardiovascular Products"                                                                
"C7A"  "C7A" "Beta-blocking Agents, Plain"                                                                  
"C7B"  "C7B" "Combinations With Antihypertensives And/Or Diuretics"                                         
"C8A"  "C8A" "Calcium Antagonists"                                                                          
"C8B"  "C8B" "Calcium Antagonist/Beta-blocker Combinations"                                                 
"C9A"  "C9A" "ACE Inhibitors"                                                                               
"C9B"  "C9B" "ACE Inhibitor Combinations With All Other Drugs"                                              
"C9B"  "C9B" "ACE Inhibitor Combinations With Antihypertensives (C2) And/Or Diuretics (C3)"                 
"C9B"  "C9B" "ACE Inhibitor Combinations With Calcium Antagonists (C8)"                                     
"C9B"  "C9B" "ACE inhibitor/Beta-blocker Combinations"                                                      
"C9C"  "C9C" "Angiotensin-II Antagonists"                                                                   
"C9D"  "C9D" "Angiotensin-II Antagonist Combinations With Antihypertensives (C2) And/Or Diuretics"          
"C9D"  "C9D" "Angiotensin-II Antagonist Combinations With Beta-blockers"                                    
"C9D"  "C9D" "Angiotensin-II Antagonist Combinations With Calcium Antagonists"                              
"C9D"  "C9D" "Angiotensin-II Antagonist Combinations With Other Drugs"                                      
"C9X"  "C9X" "Other Agents Acting On The Renin-angiotensin System"                                          
"D1A"  "D1A" "Antifungals"                                                                                  
"D3A"  "D3A" "All Other Wound Healing Agents"                                                               
"D3A"  "D3A" "Skin/Dermal/Epidermal/Equivalents"                                                            
"D4A"  "D4A" "Anti-pruritics"                                                                               
"D5A"  "D5A" "Topical Antipsoriasis Products"                                                               
end
I would like to put a 0 before every number but just in the strings having three values. For instance "C9D" should become C09D, A3G A03G and so on.

Is there a way to do that? Thank you,

Federico