BookmarkSubscribeRSS Feed
MarcusX
Calcite | Level 5

I will give a picture of the text file that i am working with and the output that coming from my code. I have to read these variables in from the raw data file and use some functions on them. I am having a very hard time reading these file in properly in order for me process the functions on them. The pictures are attached below:

 

President_Data.PNGPresident_output.PNG

4 REPLIES 4
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

please provide a sample of the SAS code you used to create the second table.

 

Reeza
Super User

What is the delimiter between the variables? I suspect it's a tab, "09"x. 

Try explicitly specifying a delimiter. 

 

Please post your questions as text, not images.

 


@MarcusX wrote:

I will give a picture of the text file that i am working with and the output that coming from my code. I have to read these variables in from the raw data file and use some functions on them. I am having a very hard time reading these file in properly in order for me process the functions on them. The pictures are attached below:

 

President_Data.PNGPresident_output.PNG


 

ballardw
Super User

And with delimited data either use the : format modifier or an informat statement separate from the input statement. Without the : then the input statement is forced to read the specified number of columns such as are resulting in some of your names that are actually shorter than 18 characters to read characters from the next field.

 

PS: Post code into a code window opened with the forum's {I} icon. It is much easer to copy and paste and then we can show suggestions easier than retyping from an image.

 

Same with example text files being read. The {I} icon is plain text and will maintain appearance and columns from a text file.

Shomo_olongus
Calcite | Level 5

Please can you provide just the first 20 rows of your data (attached the file to the post) and your code, so we can help you with your code to correctly read your data?

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
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
  • 4 replies
  • 656 views
  • 0 likes
  • 5 in conversation