• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to count column text values
#1
Hi manish,
please help me... in need to count status in Active & Inactive in columns.
please find attached csv file  & code.
Code:
%Macro SUMMARY;
libname SAS 'E:\Proportionate Billing Data Summary\Summary_Data';
Data  SAS.Final_summary_july18_done;
Set SAS.Final_summary_july18;
Format ddate   YYMMDD10.;
%let A = 0 ;
%let IN = 0    ;
%Do I = 1 %to 30 %by 1;
    %If  AccountStatus&I. =  'Active' %then
    %Let A = %Eval(&A +1) ;
    %If  AccountStatus&I. =  'Inactive' %then
    %Let IN = %Eval(&IN +1) ;
%End
ACTIVE = &A.;
output;
INACTIVE = &IN.;
output;
RUN;
%Mend;

%SUMMARY;
regards,
Satendra kumar


Attached Files
.zip   SAS_dataset.zip (Size: 248 bytes / Downloads: 3)
  Reply
#2
(23-Jul-2018, 05:23 PM)Satendra Kumar Wrote: Hi manish,
please help me... in need to count status in Active & Inactive in columns.
please find attached csv file  & code.
Code:
%Macro SUMMARY;
libname SAS 'E:\Proportionate Billing Data Summary\Summary_Data';
Data  SAS.Final_summary_july18_done;
Set SAS.Final_summary_july18;
Format ddate   YYMMDD10.;
%let A = 0 ;
%let IN = 0    ;
%Do I = 1 %to 30 %by 1;
    %If  AccountStatus&I. =  'Active' %then
    %Let A = %Eval(&A +1) ;
    %If  AccountStatus&I. =  'Inactive' %then
    %Let IN = %Eval(&IN +1) ;
%End
ACTIVE = &A.;
output;
INACTIVE = &IN.;
output;
RUN;
%Mend;

%SUMMARY;
regards,
Satendra kumar

?????.....
  Reply


Forum Jump:


Users browsing this topic: 1 Guest(s)