When you are setting the address of a data item that data item must reside in the linkage section not the working-storage section. You are basically establishing addressability to these data items.
So link-record, l-param and ws-messages would have to be defined in linkage.and then after setting them to the address stored in the pointers they can be referenced.