f



Re: What does this statement do IF "" =: '*' THEN ; ? #4

Good point, I assumed that Ya was asking about the everything but the
comparison operator.

On 1/14/09, Allen Ziegenfus <aziegenfus@anaxima.com> wrote:
> That syntax is new to me. I found the description in the "Language
> Reference";
>
> "You can compare only a specified prefix of a character string by using a
> colon (:) after the comparison operator. In the following example, the colon
> modifier after the equal sign tells SAS to look at only the first character
> of values of the variable LASTNAME and to select the observations with names
> beginning with the letter S:
>
>        if lastname=:'S';
>
> Because printable characters are greater than blanks, both of the following
> statements select observations with values of LASTNAME that are greater than
> or equal to the letter S:
>
>        if lastname>='S';
>        if lastname>=:'S';
> "
>
> Allen
>
>
> -----Urspr�ngliche Nachricht-----
> Von: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Im Auftrag von Ya
> Huang
> Gesendet: Dienstag, 13. Januar 2009 19:14
> An: SAS-L@LISTSERV.UGA.EDU
> Betreff: What does this statement do IF "" =: '*' THEN ; ?
>
> Hi there,
>
> When we use %annomac provided by SAS, if mprint is turned on,
> we can sometimes see this kind of statement:
>
> IF "" =: '*' THEN ;
>
> Can someone explain what does it mean? Why it is used?
>
> Thanks
>
> Ya
>
0
iebupdte (1706)
1/14/2009 11:56:24 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
343 Views

Similar Articles

[PageSpeed] 16

Reply:

Similar Artilces:

Re: Mandis Quotes (aka retiring """ and ''')
Russell Nelson wrote: > If you need to put a single quote in, then you put > an arbitrary string in-between the single quotes which does NOT > appear in the string. For example, "Bill's house" becomes > 'x'Bill's house'x'. So possible examples might be: 'xx'somebody's mother'xx' 'xy'somebody's father'xy' 'wink'somebody's uncle'wink' 'quote'somebody's body'quote' not terrible easy on the eyes, and why use the single quote at all? Why no= t use a similar pattern li...

Re: Mandis Quotes (aka retiring """ and ''') #2
Russell Nelson notes: > = > Choose poor examples, and then criticize them as poor choices? > = true enough, but the suggested scheme introduces another variable into the = language syntax; I might always make good choices <wink> on what delimiter = I choose, but I might also end up working on code written by someone else w= ho makes less good choices. Or vice versa. = > Exactly. It really would be better to have one(1) string literal > which can quote anything without reverting to backslashing. Why one? > Simpler parsing, simpler learning of the language, fewe...

Re: What does this statement do IF "" =: '*' THEN ; ?
It is for folks that can't say NO. In this excerpted bit of code, if the condition is true do nothing otherwise color="... IF "&colin" =: '*' THEN ; ELSE color = "&colin"; conversely IF "&colin" NE: '*' THEN color = "&colin"; should produce the same effect. On 1/13/09, Ya Huang <ya.huang@amylin.com> wrote: > Hi there, > > When we use %annomac provided by SAS, if mprint is turned on, > we can sometimes see this kind of statement: > > IF "" =: '*' THEN ; > > Can someone explain what does it mean? Why it is used? > > Thanks > > Ya > ...

Re: What does this statement do IF "" =: '*' THEN ; ? #7
That syntax is new to me. I found the description in the "Language Reference"; "You can compare only a specified prefix of a character string by using a colon (:) after the comparison operator. In the following example, the colon modifier after the equal sign tells SAS to look at only the first character of values of the variable LASTNAME and to select the observations with names beginning with the letter S: if lastname=:�S�; Because printable characters are greater than blanks, both of the following statements select observations with values of LASTNAME that are greater than or equal to the letter S: if lastname>=�S�; if lastname>=:�S�; " Allen -----Urspr�ngliche Nachricht----- Von: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Im Auftrag von Ya Huang Gesendet: Dienstag, 13. Januar 2009 19:14 An: SAS-L@LISTSERV.UGA.EDU Betreff: What does this statement do IF "" =: '*' THEN ; ? Hi there, When we use %annomac provided by SAS, if mprint is turned on, we can sometimes see this kind of statement: IF "" =: '*' THEN ; Can someone explain what does it mean? Why it is used? Thanks Ya ...

Re: What does this statement do IF "" =: '*' THEN ; ? #11
Summary: DATA step IF or macro IF #iw-value=1 Paul, The offending line is usually IF "&colin" =: '*' THEN ; ELSE color = "&colin" ; although in the LABEL macro it is IF "&pos" =: '*' THEN ; ELSE POSITION = "&pos" ; IF "&coltxt" =: '*' THEN ; ELSE color = "&coltxt"; The construction occurs at least 18 times in 885 lines of code. In principle you are correct - make the decision of what code to generate whenever possible, but there are other considerations particularly if the amount of data is very small. Your lines %if %qsubstr (&parm, 1, 1) eq %str (*) %then %do ; A = B ; %end ; should read %if %qsubstr (&parm, 1, 1) NE %str (*) %then %do ; A = B ; %end ; But this is still wrong since the parm can be empty as Ya's question indicates. With this correction it becomes %if %length(&parm) > 0 %then %do ; %if %qsubstr (&parm, 1, 1) NE %str (*) %then %do ; A = B ; %end ; %end ; %else %do ; A = B ; %end ; or given the programmer's desire to avoid negatives %if %length(&parm) > 0 %then %do ; %if %qsubstr (&parm, 1, 1) eq %str (*) %then ; %else %do ; A = B ; %end ; %end ; %else %do ; A = B ; %end ; Now one has to wonder if the principle is so strong it is worth implementing here. To improve readability ...

Re: What does this statement do IF "" =: '*' THEN ; ? #8
Ya, That you understand the intent of what the macro generates does not yet mean that what it generates makes sense. Suppose that it is a macro variable PARM which resolves to the blank. The macro writer apparently wants to generate some SAS code, for example, the statement A = B ; if &parm begins with an asterisk, and generate nothing if it does not. Then if he coded (#1) %if %qsubstr (&parm, 1, 1) eq %str (*) %then %do ; A = B ; %end ; the goal would be achieved. However, what he had chosen to code in the macro was (#2) if "&parm" =: '*' then ; else A = B ; and so the macro generates some SAS code no matter what the value of &parm is, thus relegating the evaluation of the condition to the DATA step run time, even though it can be already evaluated at the macro execution time. The whole advantage of a code generator (including SAS macro language) is the ability to generate only SAS code needed for run-time execution, wherein also lies its potential to make the generated code more efficient. For example, #1 generates either A=B or nothing at all, and so there will be no comparison to evaluate during the run-time. #2 generates a comparison either way, making SAS evaluate the a priori falsehood if "" =: '*' if PARM is null. Kind regards ------------ Paul Dorfman Jax, FL ------------ On Wed, 14 Jan 2009 11:21:12 -0500, Ya Huang <ya.huang@AMYLIN.COM> wrote: >I was well aware of the "=:". My orig...

Re: What does this statement do IF "" =: '*' THEN ; ? #6
This technique is particularly useful in SQL as it doesn't support the colon modifier: if lastname>='S'; 2009/1/14 Allen Ziegenfus <aziegenfus@anaxima.com>: > That syntax is new to me. I found the description in the "Language > Reference"; > > "You can compare only a specified prefix of a character string by using a > colon (:) after the comparison operator. In the following example, the colon > modifier after the equal sign tells SAS to look at only the first character > of values of the variable LASTNAME and to select the observations with names > beginning with the letter S: > > if lastname=:'S'; > > Because printable characters are greater than blanks, both of the following > statements select observations with values of LASTNAME that are greater than > or equal to the letter S: > > if lastname>='S'; > if lastname>=:'S'; > " > > Allen > > > -----Urspr�ngliche Nachricht----- > Von: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Im Auftrag von Ya > Huang > Gesendet: Dienstag, 13. Januar 2009 19:14 > An: SAS-L@LISTSERV.UGA.EDU > Betreff: What does this statement do IF "" =: '*' THEN ; ? > > Hi there, > > When we use %annomac provided by SAS, if mprint is turned on, > we can sometimes see this kind of statement: > > IF "" =: '*' THEN ; > &...

Re: What does this statement do IF "" =: '*' THEN ; ? #12
Ian, The principle was all I wanted to emphasize without any particular macro in mind. Your correction, addition and remarks are of course valid as far as %annomac() is concerned; however, frankly, I had never even seen the internals of the macro (in which light it strikes me as a strange coincidence that I used A and B in my example). Now that owing to you I have seen them, it only reinforces my conviction that when a generator leaves it to the run-time environment to handle what has to be handled by the generator, then either the generated code is poorly conceived or a wrong generator is used. If the generator's logic is too complex for the macro language to handle, it should be relegated to SAS means better suited for the purpose (DATA step, SQL), leaving for the macro only simple encapsulation and parameterization. If the latter cannot be made simple, i.e. parameters are too numerous or awkward to specify, the only parm one may need in the macro is a path to a control file or files. In the real production world, the advantages of a table driven system as opposed to an equivalent macro parameter driven system are obvious, as far as I am concerned, from any single practical standpoint (development, extendability, debugging, generated code exposure, maintenance). Which of course not only excludes but rather invites the existence of a supplemental library of well written, debugged and thoroughly tested macros, especially those whose utility is not to generate SAS code...

Re: What does this statement do IF "" =: '*' THEN ; ? #3
GET would be the same as Karma's example >=: On 1/14/09, ./ ADD NAME=Data _null_, <iebupdte@gmail.com> wrote: > SQL supports the "truncation modifier" with a different syntax. > > proc sql; > select * from sashelp.class where name GTT 'C'; > quit; > run; > > On 1/14/09, karma <dorjetarap@googlemail.com> wrote: > > This technique is particularly useful in SQL as it doesn't support the > > colon modifier: > > > > if lastname>='S'; > > > > 2009/1/14 Allen Ziegenfus <aziegenfus@anaxima.com>: > > > That syntax is new to me. I found the description in the "Language > > > Reference"; > > > > > > "You can compare only a specified prefix of a character string by using a > > > colon (:) after the comparison operator. In the following example, the colon > > > modifier after the equal sign tells SAS to look at only the first character > > > of values of the variable LASTNAME and to select the observations with names > > > beginning with the letter S: > > > > > > if lastname=:'S'; > > > > > > Because printable characters are greater than blanks, both of the following > > > statements select observations with values of LASTNAME that are greater than > > > or equal to the letter S: > > > > > > ...

Re: What does this statement do IF "" =: '*' THEN ; ? #9
SQL supports the "truncation modifier" with a different syntax. proc sql; select * from sashelp.class where name GTT 'C'; quit; run; On 1/14/09, karma <dorjetarap@googlemail.com> wrote: > This technique is particularly useful in SQL as it doesn't support the > colon modifier: > > if lastname>='S'; > > 2009/1/14 Allen Ziegenfus <aziegenfus@anaxima.com>: > > That syntax is new to me. I found the description in the "Language > > Reference"; > > > > "You can compare only a specified prefix of a character string by using a > > colon (:) after the comparison operator. In the following example, the colon > > modifier after the equal sign tells SAS to look at only the first character > > of values of the variable LASTNAME and to select the observations with names > > beginning with the letter S: > > > > if lastname=:'S'; > > > > Because printable characters are greater than blanks, both of the following > > statements select observations with values of LASTNAME that are greater than > > or equal to the letter S: > > > > if lastname>='S'; > > if lastname>=:'S'; > > " > > > > Allen > > > > > > -----Urspr�ngliche Nachricht----- > > Von: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Im Auftrag von Ya...

Re: What does this statement do IF "" =: '*' THEN ; ? #13
Ian, I have found too many SAS macros on th eSAS site so lacking to the point I dont even refer my programmers to the SAS site an more. Learning poor practice I have found creates more problems than its worth. Almost makes me want to sit down and just rewrite or show the better non macro option to all the macros on the SAS site. Toby Dunn "Don't bail. The best gold is at the bottom of barrels of crap." Randy Pausch "Be prepared. Luck is where preparation meets opportunity." Randy Pausch ---------------------------------------- > Date: Thu, 15 Jan 2009 11:42:37 -0500 > From: iw1sas@GMAIL.COM > Subject: Re: What does this statement do IF "" =: '*' THEN ; ? > To: SAS-L@LISTSERV.UGA.EDU > > Summary: DATA step IF or macro IF > #iw-value=1 > > Paul, > > The offending line is usually > > IF "&colin" =: '*' THEN ; ELSE color = "&colin" ; > > although in the LABEL macro it is > > IF "&pos" =: '*' THEN ; ELSE POSITION = "&pos" ; > IF "&coltxt" =: '*' THEN ; ELSE color = "&coltxt"; > > The construction occurs at least 18 times in 885 lines of code. In > principle you are correct - make the decision of what code to generate > whenever possible, but there are other considerations particularly if > the amount of data is very small. > > Your lines >...

Re: What does this statement do IF "" =: '*' THEN ; ? #5
I was well aware of the "=:". My original question was really not about ':' modifier, rather why the left side of equal sign is a blank. After _null_ response, I understand that was actually a macro resolve to blank. Now it all make sense. On Wed, 14 Jan 2009 12:02:31 +0100, Allen Ziegenfus <aziegenfus@ANAXIMA.COM> wrote: >That syntax is new to me. I found the description in the "Language >Reference"; > >"You can compare only a specified prefix of a character string by using a >colon (:) after the comparison operator. In the following example, the colon >modifier after the equal sign tells SAS to look at only the first character >of values of the variable LASTNAME and to select the observations with names >beginning with the letter S: > > if lastname=:?S?; > >Because printable characters are greater than blanks, both of the following >statements select observations with values of LASTNAME that are greater than >or equal to the letter S: > > if lastname>=?S?; > if lastname>=:?S?; >" > >Allen > > >-----Urspr?he Nachricht----- >Von: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Im Auftrag von Ya >Huang >Gesendet: Dienstag, 13. Januar 2009 19:14 >An: SAS-L@LISTSERV.UGA.EDU >Betreff: What does this statement do IF "" =: '*' THEN ; ? > >Hi there, > >When we use %annomac provided by SAS, if mpr...

Re: What does this statement do IF "" =: '*' THEN ; ? #2
cause that comes from a macro resolution, I think that this is not the intention of that, but the result of a macro resolution: data test; IF "&somewhat" =: '*' THEN &something; run; if &somewhat and &something is empty, the mentioned thing might be the result. Normally the should say "if the content of &somewhat starts with * then x=y+33.5; " Gerhard On Tue, 13 Jan 2009 13:13:30 -0500, Ya Huang <ya.huang@AMYLIN.COM> wrote: >Hi there, > >When we use %annomac provided by SAS, if mprint is turned on, >we can sometimes see this kind of statement: > >IF "" =: '*' THEN ; > >Can someone explain what does it mean? Why it is used? > >Thanks > >Ya ...

Re: What does this statement do IF "" =: '*' THEN ; ? #10
Yes, this was one of the *many* cool tips I saw on Phil Masons book "SAS Tips and Techniques from Around the Globe". I was also really suprised to see how many I actually sas in SAS-L first. Must be "In the Know" 2009/1/14 ./ ADD NAME=Data _null_, <iebupdte@gmail.com>: > SQL supports the "truncation modifier" with a different syntax. > > proc sql; > select * from sashelp.class where name GTT 'C'; > quit; > run; > > On 1/14/09, karma <dorjetarap@googlemail.com> wrote: >> This technique is particularly useful in SQL as it doesn't support the >> colon modifier: >> >> if lastname>='S'; >> >> 2009/1/14 Allen Ziegenfus <aziegenfus@anaxima.com>: >> > That syntax is new to me. I found the description in the "Language >> > Reference"; >> > >> > "You can compare only a specified prefix of a character string by using a >> > colon (:) after the comparison operator. In the following example, the colon >> > modifier after the equal sign tells SAS to look at only the first character >> > of values of the variable LASTNAME and to select the observations with names >> > beginning with the letter S: >> > >> > if lastname=:'S'; >> > >> > Because printable characters are greater than blanks, both of the following >> &...

Re: Unable to identify an operator '*=' for types 'character varying[]' and '"unknown"'
Okay...I answered my own question. I didn't understand from the directions that I had to compile and install the dll in contrib/array and run the array_iterator.sql. It works like a charm now. Mike -----Original Message----- From: Mike Leahy [mailto:mgleahy@fes.uwaterloo.ca] Sent: October 10, 2003 3:41 PM To: 'pgsql-general@postgresql.org' Subject: Unable to identify an operator '*=' for types 'character varying[]' and '"unknown"' Okay.I'm following the documentation that came with the PostgreSQL source code (located in /u...

'quote' to `quote'
Hi, what is the way to change 'shocking,' said Sally into `shocking', said Sally automatically as Tex read the author.txt file? Does this method also change "whatever happens," he said into ``whatever happens.'' he said. David R David R <angel_ov_north@tiscali.co.uk> wrote: > what is the way to change 'shocking,' said Sally > into `shocking', said Sally > automatically as Tex read the > author.txt file? It is possible (e.g. via an active '). But I suspect, this is a lot easier using a script language or similar. Also you should consider ['s] coming from genitive and other uses of the apostrophe. Yours sincerely Heiko <oberdiek@uni-freiburg.de> David R wrote: > what is the way to change 'shocking,' said Sally > into `shocking', said Sally > automatically as Tex read the > author.txt file? Tricky thing to do on the TeX level because you can't tell a quote from an apostrophe in a reliable and efficient way. This will probably require pre-processing of author.txt (it's no big deal with regular expressions). > Does this method also change "whatever happens," he said > into ``whatever happens.'' he said. Assuming you're using Latex: try the csquotes package. See \MakeOuterQuote{"} in the tutorial. -- Sender address blackholed; do not reply to From: address. You can still reach me by email at: plehman gmx net. On Wed, 10 Ja...

Dev C++ Err "expected `]' before ';' token" / source "DWORD rtec_Stack[XYZ_SIZE] __attribute__((aligned(4)));"
In Dev C++, we tried to compile a application, but it will throw some peculiar error. please find it below "path/main.cpp expected `]' before ';' token" and the source code is "DWORD rtec_Stack[XYZ_SIZE] __attribute__((aligned(4)));" is this problem of envirnment or else? nagaraj wrote: > In Dev C++, we tried to compile a application, but it will throw some > peculiar error. please find it below > > "path/main.cpp expected `]' before ';' token" and the source code is > "DWORD rtec_Stack[XYZ_SIZE] __attribute__((align...

What does this statement do IF "" =: '*' THEN ; ?
Hi there, When we use %annomac provided by SAS, if mprint is turned on, we can sometimes see this kind of statement: IF "" =: '*' THEN ; Can someone explain what does it mean? Why it is used? Thanks Ya ...

expect script : "expect 'X', send 'Y'" until expect "Z".
Hi. I am having some difficulties with an expect script, and was hoping someone could help me out here. I am running a scripted telnet session to some 'black box' appliance, and would like to retrieve the output of a particular command. However, the output of the command is longer than a single screen full. Since it was designed for interactive use, you get the magic string "[=More (xx%)=]" after each screenfull of output, at which point the command expects you to hit the spacebar in order to get another screenfull of output. Of course, I could just "send <space>" a few times, but since I have no idea how long the output will be in advance, this does not appear to be such a good approach. It looks like I would have to do something were I keep sending a space as long as I keep getting/expecting the string "[=More (xx%)=]", and stop doing that after I have gotten/expected the prompt again. (which is "% "). Does anyone have any idea on how to do such a thing in expect ? Of course, other suggestions to tackle the same problem are welcome as well of course. Sincerely, John Smith. "J.Smith" <lbalbalba@hotmail.com> wrote in message news:737da4e2.0410200305.1f12696f@posting.google.com... > Hi. > > > I am having some difficulties with an expect script, and was hoping > someone could help me out here. > > > I am running a scripted telnet session to some 'black box' applianc...

Re: What does ASCII '1A'X ("sub") mean? #4
That's the INCLUDE *command*. As far as I know there is no INCLUDE statement. On Mon, 17 Nov 2003 09:07:04 -0500, Fehd, Ronald J. (PHPPO) <rjf2@CDC.GOV> wrote: >> From: Howard Schreier [mailto:Howard_Schreier@ITA.DOC.GOV] >> Right. I don't find anything on the SAS site indicating that >> it is a system option. Rather, it works in the FILENAME and >> INFILE statemnets, as you indicate. >> >> See >> http://support.sas.com/techsup/unotes/SN/003/003632.html >> >> Then there is >http://support.sas.com/documentation/onlinedo...

Re: [ace-users] Compile time error: "error: 'write_n' is not a member of 'ACE'"
Hi, You lack an include, include "ace/ACE.h" in your program Regards, Johnny Willemsen Remedy IT Postbus 101 2650 AC Berkel en Rodenrijs The Netherlands www.theaceorb.nl / www.remedy.nl "Paresh" <pareshspednekar@gmail.com> wrote in message news:<1173985162.346951.209100@y66g2000hsf.googlegroups.com>... > Hi All, > > ACE VERSION: 5.5.6 > HOST MACHINE and OPERATING SYSTEM: LINUX, Kernel 2.6.19-1.2288.fc5, > i686 > > I tried to compile the program given below, but was giving following > compilation error: > Please help me to compile this proram > > --------------------------------------- > COMPILATION------------------------------------------ > [root@paresh ACE_MSG_BLOCK]# g++ main.C -o main -lACE -IACE_ROOT > main.C: In function 'int main(int, char**)': > main.C:9: error: 'read_n' is not a member of 'ACE' > main.C:20: error: 'write_n' is not a member of 'ACE' > ----------------------------------END > COMPILATION-------------------------------------------- > > > > ---------------------------------------------PROGRAM > main.C--------------------------------------------- > > #include "ace/OS.h" > #include "ace/Message_Block.h" > > int main(int argc, char* argv[]) { > ACE_Message_Block *head = new ACE_Message_Block(BUFSIZ); > ...

Re: OT: Dumping Denny Won't Do It "but it's a good start" #4
Brice, it does. Break a couple more legs and in the end, there is only 1 left. So, were is this huge democracy? And this should be exported to other=20 countries. Why? Or even be an example of how other countries should be run? WHY? --------------------- It is still a vast improvement over how these other countries are run. It is true some people use the word 'Democracy' like it is some sort of trump card when the real 'trump' is 'Consent of the Governed'=20=20 These other countries need a way to have a choice over what kind of government they want and &...

Re: What's wrong with this: street_n=addr1_1|" "||addr2||" "||addr3||" "||addr4||" "||addr5
Dear Dyang, You have this street_n=addr1_1|" "||addr2||" "||addr3||" "||addr4||" "||addr5 ; But I think you want this street_n=addr1_1||" "||addr2||" "||addr3||" "||addr4||" "||addr5; HTH, Charles Patridge "Charles Patridge" <charles_s_patridge@PRODIGY.NET> wrote in message news:200403041919.i24JJEo15087@listserv.cc.uga.edu... > Dear Dyang, > > You have this > > street_n=addr1_1|" "||addr2||" "||addr3||" "||addr4||" "||addr5 ; > > B...

Unable to identify an operator '*=' for types 'character varying[]' and '"unknown"'
Okay.I'm following the documentation that came with the PostgreSQL source code (located in /usr/doc/postgresql-7.3.4-2/html/arrays.hmtl in my cygwin root). I created have a table with a varchar array in it, kind of like the following: CREATE TABLE tbl_db_usuario_detalles (NOMBRE varchar(50), COD_USE varchar(6)[]); I've added a single record that has two values. It is imported from a tab-separated text file that has one line, like the following: Username {xxxxxx,yyyyyy} The import seems to work fine (if I put quotes around the string values in the array it fails). ...

Web resources about - Re: What does this statement do IF "" =: '*' THEN ; ? #4 - comp.soft-sys.sas

Resources last updated: 3/16/2016 1:35:30 PM