subroutine addattribute Foreach dataset Set default extension Open datset Foreach attributename Determine actual extension Add or Replace attribute with appropriate type, value, comment and units. End Foreach Close dataset End Foreach end subroutine addattribute