The following is my attempt at SAS Golf, where in a Data Step, I try to list the associations of a metadata object to the log. This is basically just taking advantage of combining SAS for loops with SAS while loops. I thought it was cool. Usually I find myself doing this with metadata_getnasn, metadata_getnprp, and metadata_getnobj

  • n - index for the nth association
  • u - uri to object
  • a - association
data;
  ...
  do n=1 by 1 while(n<r or r<=0);
    r=metadata_getnasl(u,n,a);
    put a;
  end;
  ...
run;

UPDATE: The metadata_getnass function has been renamed to metadata_getnasn