There is a PIDEXPORT command also, but neither Data extraction or the pid export will get you the program code unless you modify your blocks to include the program code as an attribute. But that will only work for blocks, no lines.

Without updating all blocks to include the attribute, to get the program code from a pid, you need to get it from the database or by using code and looking at the xdata.

The example below is from a valve and the line with 65 is the line for the program code.

Code:
Command: XDLIST
Select object:
Enter application name <*>:
* Registered Application Name: CFD1
* Code 1002, Starting or ending brace: {
* Code 1000, ASCII string:
* Code 1000, ASCII string:
* Code 1000, ASCII string:
* Code 1000, ASCII string: 65
* Code 1071, 32-bit signed long integer: 4
* Code 1070, 16-bit integer: 128
* Code 1070, 16-bit integer: 303
* Code 1005, Database handle: D5
...
_________________________
matt worland
ECE Design