DATA Step, Macro, Functions and more

Proc append

Accepted Solution Solved
Reply
Contributor Boa
Contributor
Posts: 21
Accepted Solution

Proc append

[ Edited ]

 

Buyingid                      Customerid                purchasedate             City                  numunits            numorderlines

1232                               121211                    12OCT09               Farifield                  45                            1

1233                               353412                     15OCT09               Newyork                 1                             1

1234                               343121                    30NOV12               Japan                      2                             1

 

Question:  Display only the customerid and firstname.

 

 


Accepted Solutions
Solution
‎11-26-2016 12:06 PM
Valued Guide
Posts: 797

Re: Proc Append of Proc SQL?

You should filter the buying dataset using the buyingid variable prior to the inner join.  Take a look at the "where" clause for sql.

View solution in original post


All Replies
Contributor Boa
Contributor
Posts: 21

Proc Append of Proc SQL?

[ Edited ]
 
 
Super User
Posts: 17,837

Re: Proc Append of Proc SQL?

Your code seems incorrect. 

 

You would first filter your table 2 based on purchase and then get the corresponding names from table 1. 

 

Given your question  and data, I'm not sure how you'd filter as there isn't an item code that I can see. 

Valued Guide
Posts: 797

Re: Proc Append of Proc SQL?

Is there a reason you're not doing this entirely within SQL?

Contributor Boa
Contributor
Posts: 21

Re: Proc Append of Proc SQL?

[ Edited ]

 

Thanks. 

Solution
‎11-26-2016 12:06 PM
Valued Guide
Posts: 797

Re: Proc Append of Proc SQL?

You should filter the buying dataset using the buyingid variable prior to the inner join.  Take a look at the "where" clause for sql.

☑ This topic is SOLVED.

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

Discussion stats
  • 5 replies
  • 476 views
  • 0 likes
  • 3 in conversation