| Date: | Sat, 31 Oct 2009 16:31:58 -0700 |
| Reply-To: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Subject: | Re: Doing arithmetics based on character values |
|
| In-Reply-To: | <57f5c70d-0564-46f5-a81e-68ae809f1df5@m16g2000yqc.googlegroups.com> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
Rune,
If I correctly understand what you're asking, the answer can be found
at:
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000780416.htm
Art
-----------
On Oct 31, 5:42 pm, Anaconda <r...@fastlane.no> wrote:
> I wonder how to do make aritmetics in as well numeric as charater
> columns based on character values.
> How is col_3 and col_4 in TEST_2 calculated based on the values of
> col_1 and col_2 in TEST_1?
>
> - Anaconda
>
> data test_1;
> infile datalines;
> input
> @01 col_1 $6.
> @10 col_2 $6.
> ;
> datalines;
> 423 234
> ;
> run;
>
> data test_2;
> set test_1;
> length col_3 8.;
> length col_4 $8.;
> col_3 = /* col_1 + col_2 */;
> col_4 = /* col_1 - col_2 */;
> run;
|