BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PROCDATARUN
Obsidian | Level 7

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 

OrderSetTrack Subgroup
O123O123O123JOO

 

Expected

 

OrderSetTrack Subgroup
O123J001456YA
O123J001456YB
O123J001456YC
O123J0013284GA
O123J0013284GB
O123J0015657GA
1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

1 REPLY 1
Kurt_Bremser
Super User

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 302 views
  • 1 like
  • 2 in conversation