In the following example, the parameter in the attribute specification needs to be a constant, not the variable field s.
$set ilusing"System.Xml.Serialization" class-id. myClass. 01 s string. 01 i binary-long attribute XmlAttribute(s). end class.