Skip to main content

DEPRECATED

attribute := expression : DEPRECATED [ ( message ) ] ;

attributeThe name of the Attribute.
expressionThe definition of the attribute.
messageOptional. The text to append to the warning if the attribute is used.

The DEPRECATED service displays a warning when the attribute is used in code that instantiates a workunit or during a syntax check. This is meant to be used on attribute definitions that have been superseded.

When used on a structure attribute (RECORD, TRANSFORM, FUNCTION, etc.), this must be placed between the keyword END and its terminating semi-colon.

Example:

  OldSort := SORT(Person,Person.per_first_name) : DEPRECATED('Use NewSort instead.');
  NewSort := SORT(Person,-Person.per_first_name);
  
  OUTPUT(OldSort); 
  //produces this warning:
  // Attribute OldSort is marked as deprecated. Use NewSort instead.
  
  //**********************************************
  ds := DATASET(['A','B','C'],{STRING1 letter});
  
  R1 := RECORD
    STRING1 letter;
  END : DEPRECATED('Use R2 now.');
  
  R2 := RECORD
    STRING1 letter;
    INTEGER number;
  END;
  
  R1 Xform1(ds L) := TRANSFORM
    SELF.letter := Std.Str.ToLowerCase(L.letter);
  END : DEPRECATED('Use Xform2 now.');
  
  R2 Xform2(ds L, integer C) := TRANSFORM
    SELF.letter := Std.Str.ToLowerCase(L.letter);
    SELF.number := C;
  END;
  
  OUTPUT(PROJECT(ds,Xform1(LEFT))); //produces these warnings:
  // Attribute r1 is marked as deprecated. Use R2 now.
  // Attribute Xform1 is marked as deprecated. Use Xform2 now.