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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.