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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.