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

Hi all, somebody help, I happen to have a dataset, where by i want to read the second column and the third column, The dataset is in csv format, so  the first column does n't have a name, how can i capture this under the input statement?

 

*reading in the data;
data passenger;
  infile "path " dsd firstobs=2;
  input  time airpassengers;
run;

This is the code am using.

 

 this is how the dataset looks like in csv format 

himself_0-1596698226125.png

The output is like this 

himself_1-1596698274909.png

So the output has not captured the second column, kindly help 
Thanks!!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

In the input-statement just add a variable for the unnamed column and add a drop-statement to prevent the variable from being written to the dataset.

input ignore_me time airpassengers;
drop ignore_me;

View solution in original post

2 REPLIES 2
andreas_lds
Jade | Level 19

In the input-statement just add a variable for the unnamed column and add a drop-statement to prevent the variable from being written to the dataset.

input ignore_me time airpassengers;
drop ignore_me;
himself
Quartz | Level 8
Hi thanks Alot, it has worked out

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
  • 2 replies
  • 628 views
  • 1 like
  • 2 in conversation