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

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
Pyrite | Level 9
Hi thanks Alot, it has worked out
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1295 views
  • 1 like
  • 2 in conversation