solutions07
Programmer
Hi All,
I have just started programming in SAS couple of days back and I am stuck at a point where I am not able to see a solution.
I have following data -
File lookup:
A B
20 1000
20 1001
20 1002
21 1003
21 1004
21 1005
22 1006
22 1007
23 1008
23 1009
23 1010
File Consumer Data:
CID A B
abc 20 1001
abc 20 1002
abc 21 1005
abc 22 1007
xyz 20 1002
xyz 21 1004
xyz 22 1006
xyz 23 1010
The out file should have:
ID A B Flag
abc 20 1000 0
abc 20 1001 1
abc 20 1002 1
abc 21 1003 0
abc 21 1004 0
abc 21 1005 1
abc 22 1006 0
abc 22 1007 1
abc 23 1008 0
abc 23 1009 0
abc 23 1010 0
xyz 20 1000 0
xyz 20 1001 0
xyz 20 1002 1
xyz 21 1003 0
xyz 21 1004 1
xyz 21 1005 0
xyz 22 1006 1
xyz 22 1007 0
xyz 23 1008 0
xyz 23 1009 0
xyz 23 1010 1
So basically, look up would be used like a library to merge on for each customer id and setting binary 0 or 1 based on the condition that consumer picked the tuple A B or not.
I can very easily think of solving it in JAVA/C++ but I want to learn a solution in SAS.
Thanks for all the help!
I have just started programming in SAS couple of days back and I am stuck at a point where I am not able to see a solution.
I have following data -
File lookup:
A B
20 1000
20 1001
20 1002
21 1003
21 1004
21 1005
22 1006
22 1007
23 1008
23 1009
23 1010
File Consumer Data:
CID A B
abc 20 1001
abc 20 1002
abc 21 1005
abc 22 1007
xyz 20 1002
xyz 21 1004
xyz 22 1006
xyz 23 1010
The out file should have:
ID A B Flag
abc 20 1000 0
abc 20 1001 1
abc 20 1002 1
abc 21 1003 0
abc 21 1004 0
abc 21 1005 1
abc 22 1006 0
abc 22 1007 1
abc 23 1008 0
abc 23 1009 0
abc 23 1010 0
xyz 20 1000 0
xyz 20 1001 0
xyz 20 1002 1
xyz 21 1003 0
xyz 21 1004 1
xyz 21 1005 0
xyz 22 1006 1
xyz 22 1007 0
xyz 23 1008 0
xyz 23 1009 0
xyz 23 1010 1
So basically, look up would be used like a library to merge on for each customer id and setting binary 0 or 1 based on the condition that consumer picked the tuple A B or not.
I can very easily think of solving it in JAVA/C++ but I want to learn a solution in SAS.
Thanks for all the help!