Hi ballardw and Art, Many thanks. Hi Art, What you have suggested works. Thanks. I would like to ask your help to learn another aspect from your code. data need; set have (rename=(Days_Past=_Days_Past)); Days_Past=input(_Days_Past, ?? 12.); run; Above code performs sequentially what I have shown below: 1). It takes the character variable named Days_Past from work.have and renames it to _Days_Past 2). Then the _Days_Past variable is converted into a numeric variable and gives the name Days_Past double question mark (??) modifier suppresses the printing of both the error messages and the input lines when invalid data values are read. Am I correct? Question: How come then the following code does the job differently (I have explained the sequence after the below code). data work.want (rename = (N_VAR1= VAR1 N_VAR2 = VAR2 N_VAR3 = VAR3)); set work.have ; N_VAR1 = input(VAR1, 8.); N_VAR2 = input (VAR2,8.); N_VAR3 = input (VAR3, 8.); drop VAR1 VAR2 VAR3 ; run; 1). First, it takes 3 character variables named VAR1, VAR2 and VAR3 from work.have dataset and then converts each one of them into numeric variables giving names N_VAR1, N_VAR2 and N_VAR3 respectively. Whereas in your code, renaming was done first. How in the second code variable conversion happend first? 2). Then drops 3 character variables named VAR1, VAR2 and VAR3 3). Then it gets 3 numeric variables named N_VAR1, N_VAR2 and N_VAR3, and then renames them back into VAR1, VAR2 and VAR3 Is this correct? Could you please help me to understand this differential behavior of seemingly same two codes. Thanks M.
... View more