Re: changing SAS proc format to if-then-else

2010-06-21 Thread Bob goolsby
This is PERL-beginners. For answering questions about the **Perl** language. SAS was an interesting experiment twenty years ago. B On Sun, Jun 20, 2010 at 4:42 PM, papu wrote: > Hi All, > > I would like to change SAS proc format to if-then-else statements. Can > someone gui

changing SAS proc format to if-then-else

2010-06-21 Thread papu
Hi All, I would like to change SAS proc format to if-then-else statements. Can someone guid me? Thanks. /*old file*/ %let _V0= var1; /* xnbntl75_n */ %let _V1= var2; /* pct_pay_bal_cyc_1 */ proc format; value V_0_f/* var1 */ 0 -<

Re: if then else

2001-06-11 Thread Hasanuddin Tamir
On Fri, 8 Jun 2001, Jeff Yoak <[EMAIL PROTECTED]> wrote, > At 05:35 PM 6/8/01 -0400, Luinrandir Hernson wrote: > >ok, where did i go wrong now??? > > '=' is the assignment operator in Perl. '==' is the numeric comparison > operator and 'cmp' is the alpha which is what you want here. Ugly gotcha

Re: if then else

2001-06-09 Thread Paul Johnson
On Sat, Jun 09, 2001 at 08:37:22PM +1000, iain truskett wrote: > $previous = $ENV{HTTP_REFERER} ? $ENV{HTTP_REFERER} : 'an unknown site'; > > Only one use of the variable name, thus easier to maintain =) > > Of course, there is a sideeffect in both this, the original and the one > the original

RE: if then else

2001-06-09 Thread Dave Newton
> ok, where did i go wrong now??? > ## > ##set $previous site var. > ## > if ($ENV{'HTTP_REFERER'} = "") >{$previous = "an unknown site"} >else >{$previous = "$ENV{'HTTP_REFERER'}}; = instead of eq (string comparison), and in any case even using the

Re: if then else

2001-06-09 Thread Jeff 'japhy' Pinyan
On Jun 9, Jos I. Boumans said: >$ENV{'HTTP_REFERER'} : $previous = $ENV{'HTTP_REFERER'} ? $previous = "an >unknown site"; You didn't test that. Perl parses your code: $a ? $b = $a : $b = $c; as (($a ? ($b = $a) : $b) = $c); So that $b gets $c assigned to it no matter what. Either paren

Re: if then else

2001-06-09 Thread iain truskett
* Jos I. Boumans ([EMAIL PROTECTED]) [09 Jun 2001 10:32]: > and for some abbreviation: > $ENV{'HTTP_REFERER'} : $previous = $ENV{'HTTP_REFERER'} ? $previous = "an > unknown site"; [...] > god bless one liners =) Surely you mean: $previous = $ENV{HTTP_REFERER} ? $ENV{HTTP_REFERER} : 'an unknown

Re: if then else

2001-06-09 Thread Jos I. Boumans
site" god bless one liners =) hth, Jos Boumans - Original Message - From: <[EMAIL PROTECTED]> To: "Luinrandir Hernson" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, June 09, 2001 12:16 PM Subject: Re: if then else > shouldn't

Re: if then else

2001-06-09 Thread victor
shouldn't it be if ($ENV{'HTTP_REFERER'} eq "") ? Luinrandir Hernson wrote: > ok, where did i go wrong now??? > > ## > ##set $previous site var. > ## > if ($ENV{'HTTP_REFERER'} = "") >{$previous = "an unknown site"} >else >{$previous = "$ENV{'HTT

Re: if then else

2001-06-09 Thread Jeff Yoak
At 09:01 AM 6/9/01 +0200, M.W. Koskamp wrote: >I think you dont need 'cmp' you need to use 'eq' in equations. >cmp is the alfa comparison function for sort things and stuff right? Ugh. I'd been up too long. I did mean 'eq' of course. The frightening thing is that I wrote that during a short b

Re: if then else

2001-06-08 Thread M.W. Koskamp
- Original Message - From: Jeff Yoak <[EMAIL PROTECTED]> To: Luinrandir Hernson <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, June 09, 2001 12:10 AM Subject: Re: if then else > At 05:35 PM 6/8/01 -0400, Luinrandir Hernson wrote: > >o

Re: if then else

2001-06-08 Thread JTSage
Ok, 1.) if ( defined($ENV{'HTTP_REFERER'}) (make sure it's defined too) 2.) syntax. NOT if ($ENV{'HTTP_REFERER'} = "") instead, try if ( $ENV{'HTTP_REFERER'} eq "" ) = :-: assignment == :-: logic (numerics) eq :-: logic (strings) hope this helps, ~jon --- Paul Johnson <[EMAIL PROTECTED

Re: if then else

2001-06-08 Thread JTSage
Ok, 1.) if ( defined($ENV{'HTTP_REFERER'}) (make sure it's defined too) 2.) syntax. NOT if ($ENV{'HTTP_REFERER'} = "") instead, try if ( $ENV{'HTTP_REFERER'} eq "" ) = :-: assignment == :-: logic (numerics) eq :-: logic (strings) hope this helps, ~jon --- Paul Johnson <[EMAIL PROTECTED

Re: if then else

2001-06-08 Thread JTSage
Ok, 1.) if ( defined($ENV{'HTTP_REFERER'}) (make sure it's defined too) 2.) syntax. NOT if ($ENV{'HTTP_REFERER'} = "") instead, try if ( $ENV{'HTTP_REFERER'} eq "" ) = :-: assignment == :-: logic (numerics) eq :-: logic (strings) hope this helps, ~jon --- Paul Johnson <[EMAIL PROTECTED

RE: if then else

2001-06-08 Thread Peter Cornelius
;} if $ENV{'HTTP_REFERER'}; or the even more terse. my $previous = $ENV{'HTTP_REFERER'} || "an unknown site"; Peter C. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 08, 2001 2:35 PM

Re: if then else

2001-06-08 Thread Paul Johnson
On Fri, Jun 08, 2001 at 05:35:19PM -0400, Luinrandir Hernson wrote: > ok, where did i go wrong now??? > > > ## > ##set $previous site var. > ## > if ($ENV{'HTTP_REFERER'} = "") >{$previous = "an unknown site"} >else >{$previous = "$ENV{'HTTP_REFERE

RE: if then else

2001-06-08 Thread WPhillips
else {$previous = "$ENV{'HTTP_REFERER'}}; #<--because you closed this if statement here -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 6/8/01 5:35 PM Subject: if then else ok, where did i go wrong now??? ## ##set $

Re: if then else

2001-06-08 Thread Jeff Yoak
At 05:35 PM 6/8/01 -0400, Luinrandir Hernson wrote: >ok, where did i go wrong now??? '=' is the assignment operator in Perl. '==' is the numeric comparison operator and 'cmp' is the alpha which is what you want here. Ugly gotcha since perl will hardly ever catch it for you. And damn all lang

Re: if then else

2001-06-08 Thread iansmith
On Fri, 8 Jun 2001, Luinrandir Hernson wrote: > if ($ENV{'HTTP_REFERER'} = "") >{$previous = "an unknown site"} >else >{$previous = "$ENV{'HTTP_REFERER'}}; Missing a terminating " on the last line there. You should use ; to end lines as well. Makes life easier when you a

if then else

2001-06-08 Thread Luinrandir Hernson
ok, where did i go wrong now??? ## ##set $previous site var. ## if ($ENV{'HTTP_REFERER'} = "") {$previous = "an unknown site"} else {$previous = "$ENV{'HTTP_REFERER'}};