SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

How to use first.variable to get the following output?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 89
Accepted Solution

How to use first.variable to get the following output?

Data a;
Infile cards;
Input subid name$;
Cards;
101 ashu
102 navee
103 uday
;

Data b;
Infile cards;
Input subid name$;
Cards;
201ashok
202 nav
203 ram
;

Data c;
Infile cards;
Input subid name$;
Cards;
301 rathna
302 vijju
303 abhi
;

i want output like this

101 ashu
201ashok
301 rathna
102 navee
202 nav
302 vijju
103 uday
203 ram
303 abhi


Accepted Solutions
Solution
‎09-10-2014 03:53 AM
Super Contributor
Posts: 305

Re: How to use first.variable to get the following output?

Hello,

You don't need first.variable. The following should do it:

data want;

set a;

output;

set b;

output;

set c;

output;

run;

View solution in original post


All Replies
Solution
‎09-10-2014 03:53 AM
Super Contributor
Posts: 305

Re: How to use first.variable to get the following output?

Hello,

You don't need first.variable. The following should do it:

data want;

set a;

output;

set b;

output;

set c;

output;

run;

Frequent Contributor
Posts: 89

Re: How to use first.variable to get the following output?

Thanks a ton.

CAN U JUST EXPLAIN?

Contributor
Posts: 45

Re: How to use first.variable to get the following output?

The SET statement reads the current observation from the dataset.

The OUTPUT statement tells SAS to write the current observation to a SAS data set immediately, not at the end of the DATA step.

Frequent Contributor
Posts: 89

Re: How to use first.variable to get the following output?

Thanks a lot Ravi.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 330 views
  • 3 likes
  • 3 in conversation