Dear All,
Is it possible, to write a program that converts missing values to zero and values of zero to missing for numeric variables using array statement?
Appreciate and thanks a lot for help.
Regards,
S Ravuri.
S Ravuri,
It also "will be really helpful going forward" if you could mark Ksharp's answer as "Correct". One 'Click' of yours will help saving many others who share same interest many minutes by leading them right to the point. Besides, who would want to watch movies without endings at the first place?
Thanks,
Haikuo
From mssing value to zero.
data worked; input _QueueName $24. _tran_dt :mmddyy8. _tran_tm acct_num workedkey _acct_num; format _tran_dt mmddyy8. acct_num 16.; cards; Inbound 3/8/2012 172000 3000000000064278 . 3000000000064278 C-VXX-D-CP-XXXXXXX-XXXX 3/7/2012 . 3000000000064278 11918651 3000000000064278 N-PXX-N-CP-XXXXXXXXXXXXX 3/3/2012 213400 2000000000885230 11886991 2000000000885230 N-2XX-N-KE-XXXXXXX 3/4/2012 170800 1000000000801180 11895835 1000000000801180 ; run; data worked; set worked; array _x{*} _numeric_; do i=1 to dim(_x); if missing(_x{i}) then _x{i}=0; end; run; From zero to missing value data worked; input _QueueName $24. _tran_dt :mmddyy8. _tran_tm acct_num workedkey _acct_num; format _tran_dt mmddyy8. acct_num 16.; cards; Inbound 3/8/2012 172000 3000000000064278 0 3000000000064278 C-VXX-D-CP-XXXXXXX-XXXX 3/7/2012 0 3000000000064278 11918651 3000000000064278 N-PXX-N-CP-XXXXXXXXXXXXX 3/3/2012 213400 2000000000885230 11886991 2000000000885230 N-2XX-N-KE-XXXXXXX 3/4/2012 170800 1000000000801180 11895835 1000000000801180 ; run; data worked; set worked; array _x{*} _numeric_; do i=1 to dim(_x); if _x{i}=0 then _x{i}=.; end; run;
Ksharp
Hello Ksharp,
Codes are worked very well and i really appreciate for your help.
If you don't mind, what is the significance of "_numeric_ " Automatic variable which you used in the code ?
Can you please share if you have a list of Automatic variables in SAS with explanations and that will be really helpful going forward.
Regards,
S Ravuri.
S Ravuri,
It also "will be really helpful going forward" if you could mark Ksharp's answer as "Correct". One 'Click' of yours will help saving many others who share same interest many minutes by leading them right to the point. Besides, who would want to watch movies without endings at the first place?
Thanks,
Haikuo
_numeric_ is a representor of all the numeric variables in this dataset.
There are some other variable listing way which can save you lots of time in the documentation.You should search it on your own at support.sas.com .
Ksharp
It's not an automatic variable. It is a SAS Variable List.
sambasiva.ravuri@tcs.com wrote:
Hello Ksharp,
Codes are worked very well and i really appreciate for your help.
If you don't mind, what is the significance of "_numeric_ " Automatic variable which you used in the code ?
Can you please share if you have a list of Automatic variables in SAS with explanations and that will be really helpful going forward.
Regards,
S Ravuri.
Haikuo,
Am already did that. Thanks for suggestion. Am between couple of meetings.So that is the reason am not able to do it on time and am sorry for that.
Regards,
S Ravuri.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: