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


Upload your resume securely at https://www.dwsimpson.com
to be contacted when our jobs meet your skills and objectives.


Reply
 
Thread Tools Search this Thread Display Modes
  #91  
Old 03-09-2012, 04:18 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,708
Blog Entries: 2
Default

Quote:
Originally Posted by T-roy Boy View Post
I used this but it gives me this error:

ERROR 22-322: Syntax error, expecting one of the following: a name, -, :, FORMAT, INFORMAT, LABEL, LABLE, LENGTH, TRANSCODE, _ALL_,
_CHARACTER_, _CHAR_, _NUMERIC_.
Sorry. My bad.

Try using RETAIN.

data newtable;
RETAIN var5 var3 var4 var1 var2;
set prevtable;
run;
__________________
If at first you don't succeed, you have one data point.
Res ipsa loquitur, sed quid in infernos dicet?
Reply With Quote
  #92  
Old 03-09-2012, 04:39 PM
T-roy's Avatar
T-roy T-roy is offline
Member
SOA
 
Join Date: May 2002
College: UW Whitewater
Favorite beer: FFF GBH/NG Moon Man
Posts: 8,760
Blog Entries: 1
Default

Quote:
Originally Posted by BassFreq View Post
Sorry. My bad.

Try using RETAIN.

data newtable;
RETAIN var5 var3 var4 var1 var2;
set prevtable;
run;
sweet. If you don't use a KEEP statement for var1-5 then the stuff in the RETAIN is ordered first and then the other variables come after.
__________________
Quote:
Originally Posted by ORLYLOL View Post
Beer is ****ing amazing
Reply With Quote
  #93  
Old 03-12-2012, 10:23 AM
oofta's Avatar
oofta oofta is offline
Member
SOA
 
Join Date: Sep 2010
Posts: 4,637
Default

-importing a file to SAS from excel
-contains a date in format like 17mar2000:00:00:00 imported as character
-want it to be formatted like 200003

tried

newdate=datepart(date1);
put newdate=yymmn7.;
__________________
If you think this has a happy ending, you haven't been paying attention.
Reply With Quote
  #94  
Old 03-12-2012, 07:23 PM
McBride McBride is offline
Member
CAS SOA
 
Join Date: Oct 2006
Posts: 73
Default

put, as you are using it here, is a function, so you have to have it on the right side of the equal sign. Try newdate = put(datepart(date1), yymmn7.);

If that doesn't work, try newdate=input(datepart(date1), yymmn7.);

I always have trouble with put vs. input, so I always end up having to try both.
Reply With Quote
  #95  
Old 04-24-2012, 08:26 PM
trainheavy trainheavy is offline
Member
 
Join Date: Dec 2010
Posts: 425
Default

I'm still kind of new to SAS and I have a question on how to include a range in a conditional statement using a data step. Here's what I have so far:

data upd.util_8(drop=PROC_CD_SYS_ID);
set upd.util_7;
length INJECTION_FLAG $1;
if PROC_CD_SYS_ID = ('1991' '1992' '20500' '20501')
then INJECTION_FLAG = 'Y';
else INJECTION_FLAG = 'N';
RUN;

The error I'm getting is:

ERROR 388-185: Expecting an arithmetic operator.

ERROR 200-322: The symbol is not recognized and will be ignored.

ERROR 180-322: Statement is not valid or it is used out of proper order.

My main question is, how do I in a data step say if it's any of of these numbers, then Y otherwise N?

Thanks!
Reply With Quote
  #96  
Old 04-24-2012, 08:34 PM
ADoubleDot's Avatar
ADoubleDot ADoubleDot is offline
Member
SOA
 
Join Date: Nov 2007
Location: Slightly Dusty South
Studying for the rest of my life
Posts: 37,141
Default

Should be: if PROC_CD_SYS_ID in ('1991' '1992' '20500' '20501')
__________________
ADoubleDot: I'm an actuarial icon.

**** Juan.
Reply With Quote
  #97  
Old 04-25-2012, 07:30 AM
trainheavy trainheavy is offline
Member
 
Join Date: Dec 2010
Posts: 425
Default

Ha - thanks. Funny thing is I had that but never actually ran it because I didn't think it was right initially. When using proc sql the "in" turns blue indicating it's correct but it doesn't when using a data step so I assumed it was wrong - my mistake.

Thanks again!
Reply With Quote
  #98  
Old 05-18-2012, 09:37 AM
crabber crabber is offline
Member
CAS
 
Join Date: Nov 2008
Posts: 10,326
Default

Hi AO SAS experts,

I work for a small company with a small actuarial staff (no credentialed actuaries on staff). We don't use SAS at all but I want to learn it. What would be your recommendation for how I should get started? I would need to make a case to my boss to pay for any expenses, so I would want to propose a reasonably cheap course of action. Assume I have little to no programming experience.

Would buying the learning edition and going through a "teach yourself SAS" book be your recommendation? Ideally I would want to learn enough to be able to show my boss the potential benefits, but I understand that the learning edition is limited to sample data provided by SAS, so with this approach I wouldn't be able to do a simple real-life application to demonstrate the benefits.

Actually, there are a few people in our IT department who use SAS for data handling purposes, and I have inquired as to whether they have any unused licenses I could take advantage of. If I can get the base product installed on my machine, what would be your training recommendation? Is it worth pursuing the education path offered by SAS? It looks pretty expensive, and I don't know if my boss would go for it.

Thanks very much!
Reply With Quote
  #99  
Old 05-18-2012, 10:46 AM
McBride McBride is offline
Member
CAS SOA
 
Join Date: Oct 2006
Posts: 73
Default

+1 on the unused license idea. Getting the real deal will definitely be the way to go IMHO because nothing says buy me better than showing someone the benefits of a product when using that someone's data.

If you can get a license, I would recommend getting a copy of the book used in the introductary course as it is cheaper than the course. I would also recommend a copy of the book "The Little SAS Book" or a copy of "SAS for Dummies". Those would get you started. From there, make liberal use of the SAS-L message board and Lex Jansen's search of Global Forum papers. Lot's of good information there for free.
Reply With Quote
  #100  
Old 05-18-2012, 11:45 AM
BassFreq's Avatar
BassFreq BassFreq is offline
Member
CAS
 
Join Date: Jun 2003
Location: Chicago
Studying for all eternity
Favorite beer: Duff
Posts: 1,708
Blog Entries: 2
Default

Crabber,
DAP is freeware that has similar syntax to SAS. It doesn't have all the features of SAS, but should provide a good enough intro. http://www.gnu.org/software/dap/

I've never tried it myself. If you give it a try, let us know here what you think.
__________________
If at first you don't succeed, you have one data point.
Res ipsa loquitur, sed quid in infernos dicet?
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 07:12 AM.


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