Actuarial Outpost
 
Go Back   Actuarial Outpost > Actuarial Discussion Forum > Software & Technology
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions

Browse Open Actuarial Jobs

Life  Health  Casualty  Pension  Entry Level  All Jobs  Salaries


Reply
 
Thread Tools Search this Thread Display Modes
  #121  
Old 12-26-2012, 12:00 PM
Actuarialsuck Actuarialsuck is offline
Member
 
Join Date: Sep 2007
Posts: 6,148
Default

Do you need to do it in 2 queries? Can you do an append and then group by on the entries.
__________________
Quote:
Originally Posted by Buru Buru View Post
i'm not. i do not troll.
Reply With Quote
  #122  
Old 12-26-2012, 01:02 PM
Gareth Keenan's Avatar
Gareth Keenan Gareth Keenan is offline
Member
CAS
 
Join Date: Feb 2006
Location: Garden State
Studying for #9
Favorite beer: butter
Posts: 1,308
Default

I tried that, but that append won't cut it. I have premium in one table and loss in another, and I need premium and loss in the end table. I think you can only append with identical formats, or even using the force option makes the table you are appending match the format of the source table.

Any other suggestions?
Reply With Quote
  #123  
Old 12-26-2012, 04:59 PM
JMO's Avatar
JMO JMO is offline
Carol Marler
Non-Actuary
 
Join Date: Sep 2001
Location: Back home again in Indiana
Studying for Nothing actuarial.
Posts: 37,643
Default

3 passes. First, make table with all the policies with records on both. Pol #, prem, claim, whatever else.
Then append the ones with premium only, leaving claim as null. And append the ones with claim only, leaving premium null.

BFBI, it's called. Brute force and bloody ignorance works well for me.
__________________
Carol Marler, "Just My Opinion"

Pluto is no longer a planet and I am no longer an actuary. Please take my opinions as non-actuarial.


My latest favorite quotes, updated Nov. 20, 2018.

Spoiler:
I should keep these four permanently.
Quote:
Originally Posted by rekrap View Post
JMO is right
Quote:
Originally Posted by campbell View Post
I agree with JMO.
Quote:
Originally Posted by Westley View Post
And def agree w/ JMO.
Quote:
Originally Posted by MG View Post
This. And everything else JMO wrote.
And this all purpose permanent quote:
Quote:
Originally Posted by Dr T Non-Fan View Post
Yup, it is always someone else's fault.
MORE:
All purpose response for careers forum:
Quote:
Originally Posted by DoctorNo View Post
Depends upon the employer and the situation.
Quote:
Originally Posted by El Actuario View Post
Therapists should ask the right questions, not give the right answers.
Quote:
Originally Posted by Sredni Vashtar View Post
I feel like ERM is 90% buzzwords, and that the underlying agenda is to make sure at least one of your Corporate Officers is not dumb.
Reply With Quote
  #124  
Old 12-27-2012, 09:22 AM
Actuarialsuck Actuarialsuck is offline
Member
 
Join Date: Sep 2007
Posts: 6,148
Default

GK: I know there's a DISTINCT command in sql, would that help at all to incorporate that into your code?
__________________
Quote:
Originally Posted by Buru Buru View Post
i'm not. i do not troll.
Reply With Quote
  #125  
Old 12-27-2012, 12:28 PM
Gareth Keenan's Avatar
Gareth Keenan Gareth Keenan is offline
Member
CAS
 
Join Date: Feb 2006
Location: Garden State
Studying for #9
Favorite beer: butter
Posts: 1,308
Default

Hi ActuarialSuck,

I took JMO's suggestion, and it got the job done. I'll have to look into select disctint next time.
Reply With Quote
  #126  
Old 12-27-2012, 12:32 PM
MountainGirl's Avatar
MountainGirl MountainGirl is offline
Badass
Non-Actuary
 
Join Date: Feb 2007
Location: in a van down by the river
Favorite beer: free
Posts: 13,300
Default

select distinct is for when you have two rows that are identical, you will only return the one row.

sounds like you needed to use
data new;
merge set1 set2;
by allalikefields;
run;
__________________
What kind of dining set defines me as a person?

The things you own, end up owning you.
Reply With Quote
  #127  
Old 12-27-2012, 03:46 PM
Actuarialsuck Actuarialsuck is offline
Member
 
Join Date: Sep 2007
Posts: 6,148
Default

Quote:
Originally Posted by MountainGirl View Post
select distinct is for when you have two rows that are identical, you will only return the one row.

sounds like you needed to use
data new;
merge set1 set2;
by allalikefields;
run;
Would that give distinct entries? So if you merge {a,b,c} and {b,c,d} would that give {a,b,c,d}?
__________________
Quote:
Originally Posted by Buru Buru View Post
i'm not. i do not troll.
Reply With Quote
  #128  
Old 01-10-2013, 06:40 PM
MountainGirl's Avatar
MountainGirl MountainGirl is offline
Badass
Non-Actuary
 
Join Date: Feb 2007
Location: in a van down by the river
Favorite beer: free
Posts: 13,300
Default

SAS is passing the numeric stuff fine, but whatever i try, the char var won't work. any ideas?


%let email_list = ("myemail@me.com");
%put &email_list;

filename doemail email to= &email_list
subject="ALERT: Your code is f*cked up"
from="me@me.com";

data _null_;
now = put(datetime(), datetime26.6);
charvar = &charvar;
cnt_1 = &cnt_1;
cnt_2 = &cnt_2;
file doemail;
put 'You got issues for ' charvar '. There were ' cnt_1 ' policies, but because your code sucks, there were ' cnt_2 'records. This was found @: EST ' NOW ;
run;


why is it that my numeric ones pass through fine, but for the character one... let's say that charvar = "Alabama".... my log says "NOTE: Variable Alabama is uninitialized." it doesn't do that for the numbers. they are all just macro vars. so why does it work for the numbers but not the words???
__________________
What kind of dining set defines me as a person?

The things you own, end up owning you.
Reply With Quote
  #129  
Old 01-10-2013, 06:44 PM
MountainGirl's Avatar
MountainGirl MountainGirl is offline
Badass
Non-Actuary
 
Join Date: Feb 2007
Location: in a van down by the river
Favorite beer: free
Posts: 13,300
Default

Quote:
Originally Posted by Actuarialsuck View Post
Would that give distinct entries? So if you merge {a,b,c} and {b,c,d} would that give {a,b,c,d}?
sorry never saw this.

yes. this would give you a,b,c,d:

data all;
merge set1 set2;
by b,c;
run;

you have to use merge and not set.
__________________
What kind of dining set defines me as a person?

The things you own, end up owning you.
Reply With Quote
  #130  
Old 01-10-2013, 06:48 PM
MountainGirl's Avatar
MountainGirl MountainGirl is offline
Badass
Non-Actuary
 
Join Date: Feb 2007
Location: in a van down by the river
Favorite beer: free
Posts: 13,300
Default

Quote:
Originally Posted by MountainGirl View Post
SAS is passing the numeric stuff fine, but whatever i try, the char var won't work. any ideas?


%let email_list = ("myemail@me.com");
%put &email_list;

filename doemail email to= &email_list
subject="ALERT: Your code is f*cked up"
from="me@me.com";

data _null_;
now = put(datetime(), datetime26.6);
charvar = &charvar;
cnt_1 = &cnt_1;
cnt_2 = &cnt_2;
file doemail;
put 'You got issues for ' charvar '. There were ' cnt_1 ' policies, but because your code sucks, there were ' cnt_2 'records. This was found @: EST ' NOW ;
run;


why is it that my numeric ones pass through fine, but for the character one... let's say that charvar = "Alabama".... my log says "NOTE: Variable Alabama is uninitialized." it doesn't do that for the numbers. they are all just macro vars. so why does it work for the numbers but not the words???
also, this doesn't produce any errors or warnings, just a note in the log. In the email, charvar is a space but cnt1 and cnt2 are what they are supposed to be.
__________________
What kind of dining set defines me as a person?

The things you own, end up owning you.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 09:28 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
*PLEASE NOTE: Posts are not checked for accuracy, and do not
represent the views of the Actuarial Outpost or its sponsors.
Page generated in 0.43762 seconds with 10 queries