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 Display Modes
  #241  
Old 11-20-2017, 11:45 AM
Vorian Atreides's Avatar
Vorian Atreides Vorian Atreides is offline
Wiki/Note Contributor
CAS
 
Join Date: Apr 2005
Location: Hitler's Secret Bunker
Studying for ACAS
College: Hard Knocks
Favorite beer: Sam Adams Cherry Wheat
Posts: 59,548
Default

Quote:
Originally Posted by LICENSED TO ILL View Post
oh my

[Genie] Well I feel sheepish[/Genie]
IFYQ
__________________
I find your lack of faith disturbing

Why should I worry about dying? Itís not going to happen in my lifetime!


Freedom of speech is not a license to discourtesy

#BLACKMATTERLIVES
Reply With Quote
  #242  
Old 11-20-2017, 01:24 PM
ALivelySedative's Avatar
ALivelySedative ALivelySedative is online now
Member
CAS
 
Join Date: Dec 2013
Location: Land of the Pine
College: UNC-Chapel Hill Alum
Favorite beer: Red Oak
Posts: 1,572
Default

Quote:
Originally Posted by LICENSED TO ILL View Post
oh my

[Aladin] Well I feel sheepish[/Aladin]
still happens to me all the time.
__________________
1/P | 2/FM | 3F/MFE | LC | ST |4/C | 5 | 6 || 7 | 8 | 9
VEE: Econ, Fin, Stat
OC1, OC2
COP
Reply With Quote
  #243  
Old 11-28-2017, 12:08 PM
LICENSED TO ILL's Avatar
LICENSED TO ILL LICENSED TO ILL is online now
Member
 
Join Date: Oct 2005
Posts: 455
Default

When doing a SAS HASH data statement to merge two files together the variables being added to table A from table B are added on the left side of A. Is there a fancy way to add the variables to the right side of A?

It just makes sense, table A is always left most, then making new variable columns to the right, and adding variables from another table to the right of that. Right?
__________________
Spoiler:
Quote:
Originally Posted by Abelian Grape View Post
Nothing gay about mirin' another bro's gains.
Quote:
Originally Posted by campbell View Post
Want to become aware of my fist?
Reply With Quote
  #244  
Old 11-28-2017, 12:22 PM
Childish Gambino's Avatar
Childish Gambino Childish Gambino is online now
Member
SOA
 
Join Date: Jul 2014
Posts: 20,435
Default

You can do it with proc sql. Never bothered to learn the hash thing.
__________________
Quote:
Originally Posted by Pseudolus View Post
Trump's biggest weakness is that he utterly lacks the knowledge, experience, interest, attention span, temperament, and common decency to be the marginally effective President of a reasonably-large HOA.
Reply With Quote
  #245  
Old 11-28-2017, 12:43 PM
ALivelySedative's Avatar
ALivelySedative ALivelySedative is online now
Member
CAS
 
Join Date: Dec 2013
Location: Land of the Pine
College: UNC-Chapel Hill Alum
Favorite beer: Red Oak
Posts: 1,572
Default

looks like you can use a 'retain' statement to order the variables before declaring the hash. this can be annoying if you have a large number of variables though, as you have to list them all. i second the use of proc sql as i've read through the hash documentation a couple times and just find it confusing.
__________________
1/P | 2/FM | 3F/MFE | LC | ST |4/C | 5 | 6 || 7 | 8 | 9
VEE: Econ, Fin, Stat
OC1, OC2
COP
Reply With Quote
  #246  
Old 11-28-2017, 12:45 PM
LICENSED TO ILL's Avatar
LICENSED TO ILL LICENSED TO ILL is online now
Member
 
Join Date: Oct 2005
Posts: 455
Default

Quote:
Originally Posted by Childish Gambino View Post
You can do it with proc sql. Never bothered to learn the hash thing.
This is very inefficient. HASH is worth learning. Especially if there is GBs of data on two tables to sort then merge
__________________
Spoiler:
Quote:
Originally Posted by Abelian Grape View Post
Nothing gay about mirin' another bro's gains.
Quote:
Originally Posted by campbell View Post
Want to become aware of my fist?

Last edited by LICENSED TO ILL; 11-28-2017 at 01:29 PM..
Reply With Quote
  #247  
Old 11-28-2017, 01:14 PM
Childish Gambino's Avatar
Childish Gambino Childish Gambino is online now
Member
SOA
 
Join Date: Jul 2014
Posts: 20,435
Default

Quote:
Originally Posted by LICENSED TO ILL View Post
This is very inefficient. HASH is worth learning. Especially if there is GBs of data on two tables to merge
Gross oversimplification. Hash is not blanketly more efficient in all situations. Hash is extremely inefficient if the variables are not indexed whereas sql doesn't care. It's also much more error prone; the syntax is extremely clunky. There are efficiencies to be had in the coding as sql is much simpler.

Also, "GBs of data" was a lot like 10 years ago.
__________________
Quote:
Originally Posted by Pseudolus View Post
Trump's biggest weakness is that he utterly lacks the knowledge, experience, interest, attention span, temperament, and common decency to be the marginally effective President of a reasonably-large HOA.
Reply With Quote
  #248  
Old 11-28-2017, 03:28 PM
BassFreq's Avatar
BassFreq BassFreq is offline
Member
CAS
 
Join Date: Jun 2003
Location: Chicago
Studying for all eternity
Favorite beer: Duff
Posts: 1,685
Blog Entries: 2
Default

Quote:
Originally Posted by LICENSED TO ILL View Post
When doing a SAS HASH data statement to merge two files together the variables being added to table A from table B are added on the left side of A. Is there a fancy way to add the variables to the right side of A?

It just makes sense, table A is always left most, then making new variable columns to the right, and adding variables from another table to the right of that. Right?
You should be able to do something like:
if _n_ = 0 then set A B;

That will bring in the metadata for tables A and B, and the columns will be in the order you want. But that if statement has to be in the right place and somewhere near the top, maybe right after data C;.
__________________
If at first you don't succeed, you have one data point.
Res ipsa loquitur, sed quid in infernos dicet?
Reply With Quote
  #249  
Old 11-29-2017, 10:28 AM
ALivelySedative's Avatar
ALivelySedative ALivelySedative is online now
Member
CAS
 
Join Date: Dec 2013
Location: Land of the Pine
College: UNC-Chapel Hill Alum
Favorite beer: Red Oak
Posts: 1,572
Default

alright you've got me reviewing the hash stuff again. am i correct in thinking that because use of the hash requires an explicit 'output' statement that i cannot manipulate the data i'm bringing in unless using another data step after the fact? I mean, i can, but it won't actually be added to the data without another output statement, which just duplicates records, which i don't want.

ETA: Nvm...figured something out.
__________________
1/P | 2/FM | 3F/MFE | LC | ST |4/C | 5 | 6 || 7 | 8 | 9
VEE: Econ, Fin, Stat
OC1, OC2
COP

Last edited by ALivelySedative; 11-29-2017 at 03:41 PM..
Reply With Quote
Reply

Thread Tools
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 01:07 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, 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.15085 seconds with 10 queries