Actuarial Outpost Simple SAS Questions
 Register Blogs Wiki FAQ Calendar Search Today's Posts Mark Forums Read
 FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions

 Enter your email to subscribe to DW Simpson weekly actuarial job updates. li.signup { display: block; text-align: center; text-size: .8; padding: 0px; margin: 8px; float: left; } Entry Level Casualty Health Life Pension All Jobs

#231
11-10-2017, 09:21 PM
 BassFreq Member CAS Join Date: Jun 2003 Location: Chicago Studying for all eternity Favorite beer: Duff Posts: 1,691 Blog Entries: 2

Quote:
 Originally Posted by LICENSED TO ILL I am updating code in another's program and have tried a few times to get a loop+macro to work for this in a data step: if X = 1 then BASE_CC = ORIG_CC1; if X = 2 then BASE_CC = ORIG_CC2; if X = 3 then BASE_CC = ORIG_CC3; if X = 4 then BASE_CC = ORIG_CC4; if X = 5 then BASE_CC = ORIG_CC5; etc... Can anyone help me look like a SASballer plz?
Assuming all of the ORIG_CC: are next to each other and ordered...

Code:
```/* like a SASballer I */
array OG{5} ORIG_CC1-ORIG_CC5;
BASE_CC = OG(X);
/* props to BassFreq*/
/* mic drop */```
You can use that, but only if you keep my comments with it.
__________________
If at first you don't succeed, you have one data point.
Res ipsa loquitur, sed quid in infernos dicet?
#232
11-10-2017, 09:21 PM
 NormalDan Member CAS Join Date: Dec 2016 Location: NJ Posts: 4,976

Quote:
 Originally Posted by BassFreq Assuming all of the ORIG_CC: are next to each other and ordered... Code: ```/* like a SASballer I */ array OG{5} ORIG_CC1-ORIG_CC5; BASE_CC = OG(X); /* props to BassFreq*/ /* mic drop */``` You can use that, but only if you keep my comments with it.
#233
11-10-2017, 09:32 PM
 Whiskey Member CAS Join Date: Jul 2008 Studying for nothing at all Posts: 36,393

Quote:
 Originally Posted by BassFreq Assuming all of the ORIG_CC: are next to each other and ordered... Code: ```/* like a SASballer I */ array OG{5} ORIG_CC1-ORIG_CC5; BASE_CC = OG(X); /* props to BassFreq*/ /* mic drop */``` You can use that, but only if you keep my comments with it.

Should have read the question better the first time.
__________________
Whiskey "on tap" - 12/31/15
Spoiler:

Bourbon(16)
Pappy Van Winkle-Family Reserve 15yr & lot "B" 12yr
Baker's 7yr
Blanton's
Knob Creek - 9yr
Basil Hayden
Maker's Mark - 46 & Cask Strength
Woodford Reserve
Jack Daniel's-Gentleman Jack, Single Barrel & Old #7
Four Roses Small Batch
Noah's Mill
Kirkland Bourbon - 7yr

Rye(6)
Angle Envy's - Finished Rye
Ravenswood Rye
Bulleit
High West - Double Rye
Whistle Pig - 10 yr
Old Overholt

Scotch(4)
Glenfiddich - The Distiller's Edition
Tomatin 12yr
The Dimple Pinch - 15 yr
Dewar's White Label

Irish(6)

Middleton Very Rare
Redbreast 12yr
Bushmill - Single Malt 16 yr
Connemarai
Jameson - Caskmates Stout and Regular
#234
11-13-2017, 11:32 AM
 ALivelySedative Member CAS Join Date: Dec 2013 Location: Land of the Pine College: UNC-Chapel Hill Alum Favorite beer: Red Oak Posts: 1,693

Quote:
 Originally Posted by Childish Gambino This will assign the string 'orig_cc#'. He wants a variable called orig_cc#
Oh duh.

Quote:
 Originally Posted by Childish Gambino %let origCat = X; base_cc = orig_cc&origCat;
Doesn't the reference have to end with a '.' ?
ie orig_cc&origCat.;
Haven't written a macro in awhile myself so I can't remember.
__________________
1/P | 2/FM | 3F/MFE | LC | ST |4/C | 5 | 6 || 7 | 8 | 9
VEE: Econ, Fin, Stat
OC1, OC2
COP
#235
11-13-2017, 02:36 PM
 Childish Gambino Member SOA Join Date: Jul 2014 Posts: 21,055

Quote:
 Originally Posted by ALivelySedative Oh duh. Doesn't the reference have to end with a '.' ? ie orig_cc&origCat.; Haven't written a macro in awhile myself so I can't remember.
Not really. You only need the dot if you plan to continue the text. A way of telling SAS where the macro variable ends.

orig_cc&origCat.stuff;

Some people say it's good practice to put it on all the macros. But that seems like preference.
__________________
Quote:
 Originally Posted by Pseudolus 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.
#236
11-14-2017, 10:41 AM
 LICENSED TO ILL Member Join Date: Oct 2005 Posts: 483

The Array worked perfect! Thanks! everyone.
__________________
Spoiler:
Quote:
 Originally Posted by Abelian Grape Nothing gay about mirin' another bro's gains.
Quote:
 Originally Posted by campbell Want to become aware of my fist?
#237
11-14-2017, 10:59 AM
 ALivelySedative Member CAS Join Date: Dec 2013 Location: Land of the Pine College: UNC-Chapel Hill Alum Favorite beer: Red Oak Posts: 1,693

Anyone have any experience using sas/connect so as to code on PC but have it run on a company mainframe? I continue to dislike z/OS.

I'm assuming i'd need an additional base sas license for the PC version and add on sas/connect as well. I doubt i can convince anyone that the expense is worth it, but just curious if it's been done elsewhere.
__________________
1/P | 2/FM | 3F/MFE | LC | ST |4/C | 5 | 6 || 7 | 8 | 9
VEE: Econ, Fin, Stat
OC1, OC2
COP
#238
11-20-2017, 11:19 AM
 LICENSED TO ILL Member Join Date: Oct 2005 Posts: 483

OK, logic works in my head for this nested if-then-else statement. Nothing seems to get rid of the error.

IF Group = 'FirstChoice' then do;

IF years <= 2 then; Benefit_per = 2;
ELSE IF years > 10 then; Benefit_per = 99;
ELSE Benefit_per = years;

END;

ERROR 160-185: No matching IF-THEN clause.
__________________
Spoiler:
Quote:
 Originally Posted by Abelian Grape Nothing gay about mirin' another bro's gains.
Quote:
 Originally Posted by campbell Want to become aware of my fist?
#239
11-20-2017, 11:24 AM
 ALivelySedative Member CAS Join Date: Dec 2013 Location: Land of the Pine College: UNC-Chapel Hill Alum Favorite beer: Red Oak Posts: 1,693

don't need the semicolon after 'then'

Code:
```if group = 'FirstChoice' then
do;
if years <= 2 then Benefit_per = 2;
else if years > 10 then Benefit_per = 99;
else Benefit_per = years;
end;```
__________________
1/P | 2/FM | 3F/MFE | LC | ST |4/C | 5 | 6 || 7 | 8 | 9
VEE: Econ, Fin, Stat
OC1, OC2
COP
#240
11-20-2017, 11:34 AM
 LICENSED TO ILL Member Join Date: Oct 2005 Posts: 483

oh my

__________________
Spoiler:
Quote:
 Originally Posted by Abelian Grape Nothing gay about mirin' another bro's gains.
Quote:
 Originally Posted by campbell Want to become aware of my fist?

 Thread Tools Display Modes Linear Mode

 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 12:49 PM.

 -- Default Style - Fluid Width ---- Default Style - Fixed Width ---- Old Default Style ---- Easy on the eyes ---- Smooth Darkness ---- Chestnut ---- Apple-ish Style ---- If Apples were blue ---- If Apples were green ---- If Apples were purple ---- Halloween 2007 ---- B&W ---- Halloween ---- AO Christmas Theme ---- Turkey Day Theme ---- AO 2007 beta ---- 4th Of July Contact Us - Actuarial Outpost - Archive - Privacy Statement - Top