|
|
using a word as delimiter in scan
Hi All,
can i use a word as a delimiter in SCAN
eg:
data xx;
x = 'using a word as delimiter in scan';
y = scan(x,1,'in');
run;
i would like the result to be " using a word as delimiter"
but with the above step the result is "us".
i could get the result what i want using other method but is just
curious to know if this could be done in SCAN
Thanks
Rang.
|
|
0
|
|
|
|
Reply
|
rangoon
|
11/18/2010 4:49:09 PM |
|
On Nov 18, 8:49=A0am, rangoon rangoon <rangoonraja...@gmail.com> wrote:
> Hi All,
>
> can i use a word as a delimiter in SCAN
>
> eg:
>
> data xx;
> =A0 =A0 x =3D 'using a word as delimiter in scan';
> =A0 =A0 y =3D scan(x,1,'in');
> run;
>
> i would like the result to be " using a word as delimiter"
>
> but with the above step the result is "us".
>
> i could get the result what i want using other method but is just
> curious to know if this could be done in SCAN
>
> Thanks
> Rang.
Try use tranwrd to change the delimiter word to a special letter, then
use it for scan:
34 data xx;
35 x =3D 'using a word as delimiter in scan';
36 y =3D scan(tranwrd(x,' in ','~'),1,'~');
37 put x=3D / y=3D;
38 run;
INFO: Character variables have defaulted to a length of 200
(Line):(Column). Truncation may result.
36:5 y
x=3Dusing a word as delimiter in scan
y=3Dusing a word as delimiter
Note, the blank before and after is needed to make 'in' a real word.
HTH
Ya
|
|
0
|
|
|
|
Reply
|
Ya
|
11/18/2010 6:36:15 PM
|
|
On Thu, 18 Nov 2010 08:49:09 -0800 (PST), rangoon rangoon
<rangoonraja999@gmail.com> wrote:
>Hi All,
>
>can i use a word as a delimiter in SCAN
>
>eg:
>
>data xx;
> x = 'using a word as delimiter in scan';
> y = scan(x,1,'in');
>run;
>
>i would like the result to be " using a word as delimiter"
>
>but with the above step the result is "us".
That is because each character in argument 3 is an independent word
separator. The 'i' in 'in' separates the "word" us from the "word" g
in the normal word using. (The n would be ignored since it is a
separator at the start of a "word".)
>
>i could get the result what i want using other method but is just
>curious to know if this could be done in SCAN
Nope. But you could consider making your own scanwd function (or even
macro) based on Ya's response.
--
Remove del for email
|
|
0
|
|
|
|
Reply
|
Barry
|
11/19/2010 2:32:05 AM
|
|
|
2 Replies
773 Views
(page loaded in 0.129 seconds)
Similiar Articles: using a word as delimiter in scan - comp.soft-sys.sasHi All, can i use a word as a delimiter in SCAN eg: data xx; x = 'using a word as delimiter in scan'; y = scan(x,1,'in'); run; ... Merge scanned documents - comp.text.pdfspellcheck Word document after data merge with Filemaker - comp ... using a word as delimiter in scan - comp.soft-sys.sas Hi All, can i use a word as a delimiter in SCAN ... spellcheck Word document after data merge with Filemaker - comp ...using a word as delimiter in scan - comp.soft-sys.sas spellcheck Word document after data merge with Filemaker - comp ... using a word as delimiter in scan - comp.soft-sys ... Readability Statistics for PDF document - comp.text.pdfHi, I have to calculate the readability index for PDF document like the Microsoft Word. -----... Q: Scan multiple images at once - comp.graphics.apps.gimp ...using a word as delimiter in scan - comp.soft-sys.sas Q: Scan multiple images at once - comp.graphics.apps.gimp ... Hi, I use Gimp for scanning pictures. VHDL-2002 vs VHDL-93 vs VHDL-87? - comp.lang.vhdlusing a word as delimiter in scan - comp.soft-sys.sas Hi All, can i use a word as a delimiter in SCAN eg: data xx; x = 'using a word as delimiter in scan'; y = scan(x,1 ... using cat and << - comp.unix.shellusing a word as delimiter in scan - comp.soft-sys.sas Hi All, can i use a word as a delimiter in SCAN eg: data xx; x = 'using a word as delimiter in scan'; y = scan(x,1 ... How to use grep function to search exact word in HP UNIX 11.0 ...How to use grep function to search exact word in HP UNIX 11.0 ... Dear all I tried to use grep function ... is awk '{c[$0]++}END{for(i in ... to fix it if you put a delimiter ... Shortest way to read all lines (one by one) from a text file ...> > True but it's possible to use the EOF as the delimiter > > Scanner scanner = > new Scanner(new File("c:/temp/text.txt")).useDelimiter("\\Z"); > String ... Find minimum value in array - comp.soft-sys.matlabWell you don't want an "if" there (where you're stuck), you want a "for" loop, where you scan every element. And inside that for loop is where you want the if ... Functions and CALL Routines: SCAN Function - 9.2Syntax: Arguments: Details: Definition of "Delimiter" and "Word" Using Default Delimiters in ASCII and EBCDIC Environments: The Length of the Result: Using the SCAN ... using a word as delimiter in scan - comp.soft-sys.sas | Computer GroupHi All, can i use a word as a delimiter in SCAN eg: data xx; x = 'using a word as delimiter in scan'; y = scan(x,1,'in'); run; ... 7/22/2012 10:22:21 PM
|
|
|
|
|
|
|
|
|