f



'do over' doesn't work

hi,

why my code doesn't work with 'do over'. thanks.

ash007.

DATA TABLE_BIDON;
INPUT X1 X2 X3 X4 X5 $; CARDS;
2 . 5 1161 AB=C9LIEN
35 6 3 1336 ALM=C9RIC
82 1 5 1499
;RUN;

DATA TABLE_BIDON (DROP =3D _I);
	SET TABLE_BIDON;
	ARRAY A_VARNUM[*] _NUMERIC_; ARRAY A_VARCAR[*] _CHARACTER_;

	DO OVER A_VARNUM[*];
		IF A_VARNUM[*] =3D . THEN A_VARNUM[*] =3D 0;
	END;

	DO OVER A_VARCAR[*];
		IF COMPRESS(A_VARCAR[*]) IN (".","") THEN A_VARCAR[*] =3D "Z";
	END;
RUN;
0
1/24/2009 10:40:14 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
870 Views

Similar Articles

[PageSpeed] 45

Reply:

Similar Artilces:

__getattribute__ doesn't work on 'type' type for '__class__'
I'm running this version of Python: Python 2.4.3 (#1, May 18 2006, 07:40:45) [GCC 3.3.3 (cygwin special)] on cygwin I read in the documentation that these two expressions are interchangeable: x.__getattribute__('name') <==> x.name From "pydoc __getattribute__": ---8<--- Help on method-wrapper object: __getattribute__ = class method-wrapper(object) | Methods defined here: | | __call__(...) | x.__call__(...) <==> x(...) | | __getattribute__(...) | x.__getattribute__('name') <==> x.name --->8--- Yet when I...

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y" tells you whether x and y actually refer to the same object. In the case of singletons like None (there's only one None object), it's better to use "is". "ElChino" <elchino@cnn.cn>: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: Do the following: take two $10 bills. Hold one bill in the left hand, hold the other bill in the right hand. Now, the bill in the left hand "is not" the bill in the right hand. However, the bill in the left hand "==" the bill in the right hand. > Without any context, which one should be preferred? > IMHO, the latter is more readable. In almost all cases, both tests would result in the same behavior. However, the "is not" test is conceptually the correct one since you want...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

'=' command doesn't work?
Hi, i have a strange problem. It seems so simple, but : disp(['temp2=',num2str(temp2(end))]); Ergebnis(j) = temp2(end); disp(['Ergebnis=',num2str(Ergebnis(j))]); the result is : temp2=184.37 Ergebnis=1 why is Ergebnis(j) still 1? It should be 184.37. Where is the problem, i am quite confused right now. ...

Re: 'do over' doesn't work
Ash As I recall, the first SAS arrays were not subscripted and did not use direct array references. The do over statement simply said, go through the variables listed in the array starting with the first and going to the last. The erro messages that you received were telling you that you should not use the brackets on the array names. From my standpoint, the beauty of the do over is that it makes coding simpler and, given my clumsy fingers, anything that reduces my chances of screwing up are a help. However, these days, I would not choose to use a do over expression in code that was going to be used in the future since someone following me would probably not know of the syntax and the Do over has not been documented in years. The following code worked for me. DATA TABLE_BIDON; INPUT X1 X2 X3 X4 X5 $; infile cards missover;** missover added; CARDS; 2 . 5 1161 AB�LIEN 35 6 3 1336 ALM�RIC 82 1 5 1499 ;RUN; DATA TABLE_BIDON ; * no drop statement needed here; SET TABLE_BIDON; ARRAY A_VARNUM _NUMERIC_; ARRAY A_VARCAR _CHARACTER_; DO OVER A_VARNUM; IF A_VARNUM = . THEN A_VARNUM = 0; END; DO OVER A_VARCAR; IF COMPRESS(A_VARCAR) IN (".","") THEN A_VARCAR = "Z"; END; RUN; Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 ash007 <R...

Removing the letters 't' 'i' 'x' and 'y'
Im having trouble with figuring out how to write a function which will remove the letters 't' 'i' 'x' and 'y' from any input string in matlab. for example modstr(pixy) should result in ans = 'p' or modstr(picture) should result in ans = 'pcure' if anyone could offer any help or hints i would really appreciate it. Thank You >> modstr=@(s) s(~ismember(s,'tixy')) modstr = @(s)s(~ismember(s,'tixy')) >> modstr('picture') ans = pcure % Bruno ...

'=' command doesn't work? #2
Hi, i have a strange problem. It seems so simple, but : disp(['temp2=',num2str(temp2(end))]); Ergebnis(j) = temp2(end); disp(['Ergebnis=',num2str(Ergebnis(j))]); the result is : temp2=184.37 Ergebnis=1 why is Ergebnis(j) still 1? It should be 184.37. Where is the problem, i am quite confused right now. "martin Müllinger" <zettinger@gmx.de> wrote in message <i9m736$gu7$1@fred.mathworks.com>... > Hi, > > i have a strange problem. It seems so simple, but : > > disp(['temp2=',num2str(temp2(end))]); &g...

``awk ... | while read'' doesn't work.
Hi all, See my following testings: $ cat getblock.list 25 306536 13 ftp://debian.cse.msu.edu/debian/ dists/wheezy/main/installer- amd64/current/images/hd-media/boot.img.gz 34 51200 3 716760 7 ftp://debian.bononia.it/debian/ dists/jessie/main/installer- amd64/current/images/hd-media/vmlinuz 3 51200 4 734136 2 ftp://carroll.aset.psu.edu/pub/linux/distributions/debian/ dists/wheezy/main/installer-amd64/current/images/hd-media/initrd.gz 7 51200 1 787712 5 ftp://debian.balt.net/debian/ dists/jessie/main/installer- amd64/current/images/hd-media/vmlinuz 3 51200 5 419920 8 ftp://deb...

Re: 'do over' doesn't work #3
On Sat, 24 Jan 2009 14:25:41 +0000, karma <dorjetarap@GOOGLEMAIL.COM> wrote: >Hi Ash, > >What is the purpose of your code? Looking at the test data it appears >you want to replace missing numeric values with the number zero and >missing character data with a "Z". Replacing missing numerics with >zero seems like a pretty standard thing, and therefore there are a few >ways to handle this in SAS. Yes. See http://www.sascommunity.org/wiki/Generating_Zeroes_in_PROC_TRANSPOSE_Output or http://tinyurl.com/abozdc >Replacing missing character variables with >a character, on the other hand is a bit more difficult. > >You could either approach it with your array method as such: > >data have; > infile cards missover; > input x2 x1 x3 x4 x5$ x6$; > cards; >2 . 5 1161 AB�LIEN ANIEL >35 6 3 1336 ALM�RIC >82 1 5 1499 > ;run; > >data array_method; > set have; > array a_varnum _numeric_; > array a_varchar _character_; > do over a_varnum; > if missing(a_varnum) then a_varnum = 0; > end; > do over a_varchar; > if missing(a_varchar) then a_varchar = 'Z'; > end; > run; >proc print;run; > >An alternative, on your test data would also be to use a Dorfmanesque >peek/poke solution. This will only work for provided all your >character variables are a length of 8. The array statements are not >required, but it will force the...

'dd' doesn't work on NFS?
Hi, all; Both machines use Red HAt advanced server 2.1 [root@p4asus root]# dd if=/dev/zero of=/nfs-share/test bs=1M count=20 dd: writing `/oradata/test': Input/output error 2+0 records in 1+0 records out /nfs-shared is mounted on another RHAS2.1 machine. Use 'rw,no_root_squash' in '/etc/exports' file. Other operations on NFS (like, cp, mv, touch) are fine so far. Any ideas? THanks a lot! On 29 Sep 2003 14:01:14 -0700, JZ <ibm_97@yahoo.com> wrote: >Hi, all; > >Both machines use Red HAt advanced server 2.1 > >[root@p4asus root]# dd if=/dev/zero of=/nfs-share/test bs=1M count=20 >dd: writing `/oradata/test': Input/output error >2+0 records in >1+0 records out > >/nfs-shared is mounted on another RHAS2.1 machine. Use >'rw,no_root_squash' in '/etc/exports' file. Other operations on NFS >(like, cp, mv, touch) are fine so far. > >Any ideas? > Use a much smaller block size, say 8k or so, and increase the count accordingly. Villy ...

Re: 'do over' doesn't work #4
Hi Ash, What is the purpose of your code? Looking at the test data it appears you want to replace missing numeric values with the number zero and missing character data with a "Z". Replacing missing numerics with zero seems like a pretty standard thing, and therefore there are a few ways to handle this in SAS. Replacing missing character variables with a character, on the other hand is a bit more difficult. You could either approach it with your array method as such: data have; infile cards missover; input x2 x1 x3 x4 x5$ x6$; cards; 2 . 5 1161 AB�LIEN ANIEL 35 6 3 1336 ALM�RIC 82 1 5 1499 ;run; data array_method; set have; array a_varnum _numeric_; array a_varchar _character_; do over a_varnum; if missing(a_varnum) then a_varnum = 0; end; do over a_varchar; if missing(a_varchar) then a_varchar = 'Z'; end; run; proc print;run; An alternative, on your test data would also be to use a Dorfmanesque peek/poke solution. This will only work for provided all your character variables are a length of 8. The array statements are not required, but it will force the variables to occupy contiguous space which is required here. If anyone can suggest a way to make handling variable length character variables using this technique, I would very interested. data peek_poke; array nums [*] x1-x4; array chars [*] $x5 x6; set have; _n_ = dim(nums)*8; call poke(tranwrd(peekc(addr(x1),_n_),put(.,rb8.), put...

Re: 'do over' doesn't work #2
Ramsamy, The code that follows will get you into DO OVER. Do not use '*' in the dimension statements. Use the implicit index of _I_ t= o refer to individual elements of the array. DATA TABLE_BIDON; INPUT X1 X2 X3 X4 X5 $; CARDS; 2 . 5 1161 ABELIEN 35 6 3 1336 ALMERIC 82 1 5 1499 . ; RUN; DATA TABLE_BIDON ; SET TABLE_BIDON; ARRAY A_VARNUM _NUMERIC_; ARRAY A_VARCAR _CHARACTER_; DO OVER A_VARNUM; IF A_VARNUM[_i_] =3D . THEN A_VARNUM[_i_] =3D 0; END; DO OVER A_VARCAR; IF COMPRESS(A_VARCAR[_i_]) IN (".","") THEN A_VARCAR[_i_] =3D "Z"; END; RUN; Kind regards, Muthia Kachirayan On Sat, Jan 24, 2009 at 6:40 AM, ash007 <RamsamyAshley@gmail.com> wrote: > hi, > > why my code doesn't work with 'do over'. thanks. > > ash007. > > DATA TABLE_BIDON; > INPUT X1 X2 X3 X4 X5 $; CARDS; > 2 . 5 1161 AB=C9LIEN > 35 6 3 1336 ALM=C9RIC > 82 1 5 1499 > ;RUN; > > DATA TABLE_BIDON (DROP =3D _I); > SET TABLE_BIDON; > ARRAY A_VARNUM[*] _NUMERIC_; ARRAY A_VARCAR[*] _CHARACTER_; > > DO OVER A_VARNUM[*]; > IF A_VARNUM[*] =3D . THEN A_VARNUM[*] =3D 0; > END; > > DO OVER A_VARCAR[*]; > IF COMPRESS(A_VARCAR[*]) IN (".","") THEN A_VARCAR[*] =3D = "Z"; > END; > RUN; > ...

noob 'why doesn't this work' question
Hi and greetings to all group members! I'm a new Ruby user with a background in Applescript, Hypertalk (Supercard), and a little Unix. I was intrigued by Matt Neuburg's article about Applescript and Ruby, and that's what got me reading some intro books on Ruby. I just bought Textmate and I am lovin' it! Anyway, I am wondering why this seemingly simple script fails: sizeList = [0,1,2,3,4,5,6] countarray = [3,4,6] countarray.each {|x| sizeList.delete_at(x)} what I want to happen is that sizelist gets deleted at the positions specified in countArray, but the result I am gettin...

'~' and '`' keys not working
Hi all, I have FreeBSD 7.2 installed under Parrellel on MAX OSX 10.5.8, however I discovered that the '`' key and the '~' key where not working on the CLI on FreeBSD. I have tried a couple of different shells and googled for a bit but still no joy. Has this happened to anyone else. What did you do to fix it. -- ..... "When asked what he would like on his tomb stone he said more bass" Aaron Spiteri <azzmosphere> wrote: > Hi all, > > I have FreeBSD 7.2 installed under Parrellel on MAX OSX 10.5.8, however > I discovered that the '`' key and the '~' key where not working on the > CLI on FreeBSD. I have tried a couple of different shells and googled > for a bit but still no joy. > > Has this happened to anyone else. What did you do to fix it. Totally unfamiliar with Parallels, but choosing one of the other profiles in Parallels/Preferences/Keyboard may work. If it's just a mapping issue, setting a different keymap with kbdcontrol might fix it. Otherwise, it's probably something to take up with parallels.com. -- Warren Block * Rapid City, South Dakota * USA On 2009-09-17 00:55:44 +1000, Warren Block <wblock@wonkity.com> said: > Aaron Spiteri <azzmosphere> wrote: >> Hi all, >> >> I have FreeBSD 7.2 installed under Parrellel on MAX OSX 10.5.8, however >> I discovered that the '`' key and the '...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2
Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as; [Forms]![frmInvoices]![InvoiceNumber] a select query has no problem finding the field values on a form. please help. Aaron Hi Aaron, Could you post the entire code that you are having trouble with? Now it is not possible to see what goes wrong. HJ "Aaron" <aaron@rapid-motion.co.uk> wrote in message news:260d7f40.0408120245.2f3d01f8@posting.google.com... > Hi, > > Thanks for ur help there HJ. > > I know how to do the tasks you specified there. > > I would like for the update query to use field values from some of the > fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, > DateTo. My problem is that an append/update query can't find the > values in the open Form (frmInvoices) when I specify them as; > > [Forms]![frmInvoices]![InvoiceNumber] > > a select query has no problem finding the field values on a form. > > please help. > > Aaron First off, if you are not always using all the parameters specified in your form, then you have to add parameters to your query on the fly. Also, you can't just do something like qdf.SQL = "SE...

if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?
Hi, there. =20 I'm just curious if it ever dawned on anybody how to abbreviate this line : if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.')=20 =20 Igor Kurbeko Clinical Programmer Analyst 678 336 4328 ikurbeko@atherogenics.com =20 no brain no pain =20 how about: if not (str_mo in ('','.') or str_da in ('','.') or str_yy in ('','.')) OR if not (missing(str_mo) or missing(str_da) or missing(str_yy)) Eric On 22 Oct 03 21:13:37 GMT, ikurbeko@ATHER...

[OT] eclipse 'refresh' doesn't work
A tad off topic, I hope you won't all hunt me down. I'm using Eclipse 2.1.2. I edited a java source file outside of eclipse, and have just found out that eclipse caches its copy of the file (d'oh!) Apparently right clicking the file/class and hitting "Refresh" will resync the cached copy with the HD copy, but it just doesn't work. I've tried it with the file open, closed, tried it on the parent folder, I've touched the file in question many time, still no refresh. I've even relaunched eclipse, no effect. It's a simple change that I can manually make in eclipse, but I really want to know for future reference: how do I resync a file with the HD? thanks alex Alex Hunsley wrote: > A tad off topic, I hope you won't all hunt me down. > > I'm using Eclipse 2.1.2. I edited a java source file outside of eclipse, > and have just found out that eclipse caches its copy of the file (d'oh!) > Apparently right clicking the file/class and hitting "Refresh" will > resync the cached copy with the HD copy, but it just doesn't work. I've > tried it with the file open, closed, tried it on the parent folder, I've > touched the file in question many time, still no refresh. I've even > relaunched eclipse, no effect. > It's a simple change that I can manually make in eclipse, but I really > want to know for future reference: how do I resync a file with the HD? > ...

A function with 'and' , 'not' , 'null' , 'car' and 'cdr'
What's this ? (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x))))) "I suppose I should learn Lisp, but it seems so foreign." - Paul Graham, Nov 1983 On Wed, Oct 07 2015, CAI GENGYANG wrote: > What's this ? > > > (defun enigma (x) > (and (not (null x)) > (or (null (car x)) > (enigma (cdr x))))) Bad taste? It returns T if the list X contains nil as an element. It would be clearer to write (some #'null x). Helmut CAI GENGYANG ...

web('file', 'filename' '-browser') not working
Hello, I'm working on a project involving Matlab and a nice flashy GUI. To call help files, I do: web('file', 'help.html' '-browser'); On my computer, this works. After compiling it, it works. If I manage to get the current directory wrong, somehow, the browser attempts to go to www.help.com, rather than put up an error. So far so good, except when the file isn't there, which I'm ignoring for the moment. However, when I run the program on other computers (I compile the program first), it always goes to www.help.com, no matter what the pwd says, or where I put help.html. This seems to happen on about half of the other computers I try it on. Any ideas? I had thought it was just path mixups but putting 'pwd' in the appropriate places seems to indicate nothing is amiss. I do not want to use explicit path names, (ie 'file:///c:/stuff/help.html' syntax) as this program is meant for some distribution and I can't guarantee that people will always have it running from the same location. Thank you in advance, --Anne I finally did a = sprintf('file:///%shelp.html#%s', pwd, section); web('file', a, '-browser'); I discovered that the file:/// syntax does not require paths to be deliminated by '/' but can use '\' unlike what I had thought. I read a bug report that using the internal web browser crashes when using compiled code. However, a similar crash happens for me when using R2006a....

unix2dos ( tr '\12' '\15\12' ) doesn't run
Hi, m3vmsa3.caddebug /tmp > tr '\12' '\15\12' < foo > foo.tr m3vmsa3.caddebug /tmp > od -t c foo 0000000 o n e \n t w o \n t h r e e \n 0000016 m3vmsa3.caddebug /tmp > od -t c foo.tr 0000000 o n e \r t w o \r t h r e e \r 0000016 Why does tr not add '\12' to foo.tr? Thanks in advance, Jose Luis On Tue, 18 Dec 2007 04:08:26 -0800 (PST), Jose Luis wrote: > > Hi, > > m3vmsa3.caddebug /tmp > tr '\12' '\15\12' < foo > foo.tr > m3vmsa3.caddebug /tmp > od -t c ...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ##...

Difference between 'is' and '=='
Hey guys, this maybe a stupid question, but I can't seem to find the result anywhere online. When is the right time to use 'is' and when should we use '=='? Thanks alot~ mwql: >Hey guys, this maybe a stupid question, but I can't seem to find the >result anywhere online. When is the right time to use 'is' and when >should we use '=='? http://docs.python.org/ref/comparisons.html -- Ren� Pijlman mwql wrote: > Hey guys, this maybe a stupid question, but I can't seem to find the > result anywhere online. When is the right time to ...

Override 'and' and 'or'
Is it possible to override 'and' and/or 'or'? I cannot find a special method for it... __and__ and __rand__ and __or__ and __ror__ are for binary manipulation... any proposals? Have marvelous sunday, Marco Dekker <m.aschwanden@gmail.com> wrote: > Is it possible to override 'and' and/or 'or'? I cannot find a special > method for it... __and__ and __rand__ and __or__ and __ror__ are for > binary manipulation... any proposals? If you want to customize the truth value testing you have to implement __nonzero__ " __nonzero__( self) Call...

'a'..'z'
Is it possible to achieve something like this? switch (mystring.charAt(0)) { case 'a'..'z': // do something break; } "cruster" <cruster@gmail.com> wrote in message news:1151319731.988814.326200@m73g2000cwd.googlegroups.com... > Is it possible to achieve something like this? > > switch (mystring.charAt(0)) { > case 'a'..'z': > // do something > break; > } > There are times when an if statement may be more appropriate ;) Sorry - java is not VB :) -- LTP :) cruster schreef: > Is it possible to achieve somethi...

Web resources about - 'do over' doesn't work - comp.soft-sys.sas

Resources last updated: 3/16/2016 1:03:37 PM