BookmarkSubscribeRSS Feed
VALLY
Fluorite | Level 6

good day expects.

 

i am using the below script to Import txt file, however my script adds a new column called VAR1. see screen prints below. please assist

 

script

VALLY_0-1617793519859.png

Results

VALLY_1-1617793560519.png

 

4 REPLIES 4
Patrick
Opal | Level 21

Looks like the whole source string gets imported into a single variable Var1.

You define getnames=no so SAS needs to create a variable name (Var1).

The default delimiter does not match your data so the whole line gets imported into a single variable.

Kurt_Bremser
Super User

PS PROC IMPORT won't help you here in any way, as SAP unloads do not provide a header line with column names; you have to write your own data step according to the unload documentation.

andreas_lds
Jade | Level 19

Looks like a fixed-width-file, nothing to be read by proc import, but with a data step.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 563 views
  • 0 likes
  • 4 in conversation