LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 17 Nov 2008 13:57:33 +0100
Reply-To:     Allen Ziegenfus <aziegenfus@ANAXIMA.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Allen Ziegenfus <aziegenfus@ANAXIMA.COM>
Subject:      Re: substitution using an array
In-Reply-To:  <27846797-31bf-4714-a944-61146fe13834@l33g2000pri.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"

This works for me. SAS will do an automatic conversion with a BEST format, adding leading spaces, which might be confusing you.

Allen

-----Ursprüngliche Nachricht----- Von: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Im Auftrag von Tiffany Gesendet: Freitag, 14. November 2008 16:56 An: SAS-L@LISTSERV.UGA.EDU Betreff: substitution using an array

Hi,

I am trying to do a substitution for 16 fields in a data file. I am using the following array, in SAS 9.1. SAS seems to read it ok (no errors), but the values do not change to the 0 / 1 I am intending. Any ideas as to why it is not doing the substitution?

data audit; set audit; array yesno (*) in_person on_time protected_spp exp_duties duties_sheet exp_protspp trip_costs gear_meas view_gear weigh_catch samp_catch hinder coop_crew welcome offer_copy comment_card;

do i = 1 to dim(yesno);

if upcase(yesno(i)) = 'Y' then yesno(i) = 1; if upcase(yesno (i)) = 'N' then yesno(i) = 0; end; run;

thank you for any suggestions! Tiffany


Back to: Top of message | Previous page | Main SAS-L page