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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.