Skip to content

ProgramCall - Function that returns a packed variable #391

@tomcphr

Description

@tomcphr

I'm trying to call a function on a service program that returns a packed variable but I can't seem to get it working.

I get this error message:

image

Would someone be able to let me know what I'm doing wrong here? I believe it's something to do with my return method call as if I remove this the call goes through successfully.

const conn = new Connection({
    transport: 'odbc',
    transportOptions: {
        host: 'box-hostname',
        username: 'username',
        password: 'password',
    },
});
conn.debug(true);
let pgm = new ProgramCall('PROGRAMNAME', { lib: 'LIBRARY', func: 'FUNCTIONNAME', error: 'ON'});
pgm.addParam({type: '30a', value: 'TYPE', by: 'ref'});
pgm.addParam({type: '30a', value: 'REF', by: 'ref'});
pgm.addReturn({type: '20p0', value: 0});
conn.add(pgm);

conn.run((error: any, xmlOutput: any) => {
    if (error) {
        throw error;
    }
    console.log(xmlOutput);
});

Node: v20.12.2
XML Toolkit 2.0.2-dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions