data del6;
length Rank 3 Company $20 Country $25 Revenue 8 Expenses 8 NetIncome 8 Employees 8;
infile 'v:\pcsas_export_files\Delimiter6.txt' dlm = '[ ] &';
input Rank Company Country Revenue Expenses NetIncome Employees;
format Revenue Expenses NetIncome dollar14.2;
run;
sample output
1 Johnson & Johnson United States 63,747.0[20] 12,949.0 118,700
2 Pfizer United States 48,296.0[21] 8,104.0 81,800
I am trying to eliminate the & and bring Johnson and Johnson together and I want to eliminate the numbers after the revenue variable (ie 63,747.0[20]) In this case eliminate the [20]
The above script is moving the [20] and other numbers into their own field and moving Johnson into a separate field.
length Rank 3 Company $20 Country $25 Revenue 8 Expenses 8 NetIncome 8 Employees 8;
infile 'v:\pcsas_export_files\Delimiter6.txt' dlm = '[ ] &';
input Rank Company Country Revenue Expenses NetIncome Employees;
format Revenue Expenses NetIncome dollar14.2;
run;
sample output
1 Johnson & Johnson United States 63,747.0[20] 12,949.0 118,700
2 Pfizer United States 48,296.0[21] 8,104.0 81,800
I am trying to eliminate the & and bring Johnson and Johnson together and I want to eliminate the numbers after the revenue variable (ie 63,747.0[20]) In this case eliminate the [20]
The above script is moving the [20] and other numbers into their own field and moving Johnson into a separate field.