Dump Dataset to XML from Progress

Hi Mark
The following seems to work. This sort of technique is extremely useful.


DEFINE VARIABLE h AS HANDLE NO-UNDO.
h = DATASET SalesOrderDataSet:HANDLE.

h:WRITE-XML("FILE", "c:\temp\SalesDataSet_mytrace.xml").
I'm working on a .Net BPM and I'm dumping the SalesOrderDataSet to an XML file to see what fields are available and I'd like to do the same using Progress. I've tried this:

DEFINE VARIABLE cTargetType AS CHARACTER NO-UNDO.
DEFINE VARIABLE cFile AS CHARACTER NO-UNDO.
DEFINE VARIABLE lFormatted AS LOGICAL NO-UNDO.
DEFINE VARIABLE cEncoding AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSchemaLocation AS CHARACTER NO-UNDO.
DEFINE VARIABLE lWriteSchema AS LOGICAL NO-UNDO.
DEFINE VARIABLE lMinSchema AS LOGICAL NO-UNDO.
DEFINE VARIABLE retOK AS LOGICAL NO-UNDO.
/* code to populate the temp-table */
ASSIGN
cTargetType = "file"
cFile = "c:\Temp\ProgOrderSet.xml"
lFormatted = YES
cEncoding = ?
cSchemaLocation = ?
lWriteSchema = NO
lMinSchema = NO.
retOK = SalesOrderDataSet:WRITE-XML(cTargetType,
cFile,lFormatted,
cEncoding,
cSchemaLocation,
lWriteSchema,
lMinSchema).

but the code doesn't validate saying that SalesOrderDataSet is undefined, it is defined as it is passed into the BPM as an input-output parameter. Any Progress wonks see what I'm doing wrong?

Thanks!

Mark W.