data dissert1.new11;
set dissert1.new10;
array temp (*) _Auditor_During_Restated_Period _Auditor_During_Restated_Period0 _Auditor_During_Restated_Period1 _Auditor_During_Restated_Period2;
totalnum=n(_Auditor_During_Restated_Period, _Auditor_During_Restated_Period0, _Auditor_During_Restated_Period1, _Auditor_During_Restated_Period2);
count=0;
do i= 1 to dim(temp)-1;
if i=1 then count=1;
if totalnum=1 and temp(i) ne . then do;
newaudit=temp(i);
leave;
end;
if temp(i)=temp(i+1) then count+1;
if count=totalnum then do;
newaudit=temp(i);
leave;
end;
end;
run;
data dissert1.new11;
set dissert1.new10;
array temp (*) _Auditor_During_Restated_Period _Auditor_During_Restated_Period0 _Auditor_During_Restated_Period1 _Auditor_During_Restated_Period2;
totalnum=n(_Auditor_During_Restated_Period, _Auditor_During_Restated_Period0, _Auditor_During_Restated_Period1, _Auditor_During_Restated_Period2);
count=0;
do i= 1 to dim(temp)-1;
if i=1 then count=1;
if totalnum=1 and temp(i) ne . then do;
newaudit=temp(i);
leave;
end;
if temp(i)=temp(i+1) then count+1;
if count=totalnum then do;
newaudit=temp(i);
leave;
end;
end;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.