Date: Fri, 17 Sep 1999 08:08:45 +0200
Reply-To: F a b r i z i o <Fabrizio1@USA.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: F a b r i z i o <Fabrizio1@USA.NET>
Organization: KLM Royal Dutch Airlines
Subject: Re: Character Insertion
Jeff Gropp wrote in message ...
>Yep, it's me again.
>I have a character variable, X, (already in a sas data set) and I want to
>place a zero in front of each value of X. That is, if X = 789 (these #'s
>have been read as characters), I want X to equal 0789.
>Thanks,
That's an easy one, as long as each of your values still has at least 1
'empty' byte at the end of its value.
Just code: X = '0' || X;
If, however, you have values for X which are filled completely,
you first have to declare X in your datastep with a new length.
Assume your current X has maximum length 5, you might code:
DATA xxx;
LENGTH X $6;
SET xxx;
X = '0' || X;
RUN;
Brgds; Fabrizio
|