Use the FCMP function to call WRITE_ARRAY, which writes the data to a data set. Call RUN_MACRO to standardize the data in the data set. Call WRITE_ARRAY to write data to a data set. Call READ_ARRAY to read the standardized data back into the array.


proc fcmp outlib = sasuser.ds.functions;
   subroutine standardize(x[*], mean, std);
      outargs x;

      rc = write_array('work._TMP_', x, 'x1');
      dsname = 'work._TMP_';
         colname = 'x1';
         rc = run_macro('standardize', dsname, colname, mean, std);
      array x2[1]_temporary_;
         rc = read_array('work._TMP_', x2);
      if dim(x2) = dim(x) then do;
         do i = 1to  dim(x);
            x[i] = x2[i];
          end;
         end;
   endsub;
run;