How do I declare the fields correctly so the output dataset is generated as expected.
****************
data INPUT;
input
Order: $4. Set: $4. Track: $7. SubGroup: $1.;
datalines;
O123 J001 456Y A
O123 J001 456Y B
O123 J001 456Y C
O123 J001 3284G A
O123 J001 3284G B
O123 J001 5657G A
;
Actual
Order | Set | Track | Subgroup |
O123 | O123 | O123JO | O |
Expected
Order | Set | Track | Subgroup |
O123 | J001 | 456Y | A |
O123 | J001 | 456Y | B |
O123 | J001 | 456Y | C |
O123 | J001 | 3284G | A |
O123 | J001 | 3284G | B |
O123 | J001 | 5657G | A |
Make sure that the whitespace in your datalines is made out of blanks, and not some other characters.
Please use the "little running man" button for posting code, so that things like that are kept.
Make sure that the whitespace in your datalines is made out of blanks, and not some other characters.
Please use the "little running man" button for posting code, so that things like that are kept.
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 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: