Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/api/IBMi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ export default class IBMi {
});

this.runCommand({
command: `DLTOBJ OBJ(${this.config.tempLibrary}/O_*) OBJTYPE(*FILE)`,
command: `QSYS/DLTOBJ OBJ(${this.config.tempLibrary}/O_*) OBJTYPE(*FILE)`,
noLibList: true,
})
.then(result => {
Expand Down Expand Up @@ -679,7 +679,7 @@ export default class IBMi {


const QCPTOIMPF = await this.runCommand({
command: `CHKOBJ OBJ(QSYS/QCPTOIMPF) OBJTYPE(*DTAARA)`,
command: `QSYS/CHKOBJ OBJ(QSYS/QCPTOIMPF) OBJTYPE(*DTAARA)`,
noLibList: true
});

Expand All @@ -688,7 +688,7 @@ export default class IBMi {
}

const QCPFRMIMPF = await this.runCommand({
command: `CHKOBJ OBJ(QSYS/QCPFRMIMPF) OBJTYPE(*DTAARA)`,
command: `QSYS/CHKOBJ OBJ(QSYS/QCPFRMIMPF) OBJTYPE(*DTAARA)`,
noLibList: true
})

Expand Down Expand Up @@ -1017,7 +1017,7 @@ export default class IBMi {
}

const createdTempLib = await this.runCommand({
command: `CRTLIB LIB(${this.config.tempLibrary}) TEXT('Code for i temporary objects. May be cleared.')`,
command: `QSYS/CRTLIB LIB(${this.config.tempLibrary}) TEXT('Code for i temporary objects. May be cleared.')`,
noLibList: true
});

Expand All @@ -1030,7 +1030,7 @@ export default class IBMi {
}
else if (messages.findId(`CPD0032`)) { //Can't use CRTLIB
const tempLibExists = await this.runCommand({
command: `CHKOBJ OBJ(QSYS/${this.config.tempLibrary}) OBJTYPE(*LIB)`,
command: `QSYS/CHKOBJ OBJ(QSYS/${this.config.tempLibrary}) OBJTYPE(*LIB)`,
noLibList: true
});

Expand Down
2 changes: 1 addition & 1 deletion src/api/IBMiContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export default class IBMiContent {
if (this.config.autoClearTempData) {
Promise.allSettled([
this.ibmi.sendCommand({ command: `rm -rf ${tempRmt}`, directory: `.` }),
deleteTable ? this.ibmi.runCommand({ command: `DLTOBJ OBJ(${library}/${file}) OBJTYPE(*FILE)`, noLibList: true }) : Promise.resolve()
deleteTable ? this.ibmi.runCommand({ command: `QSYS/DLTOBJ OBJ(${library}/${file}) OBJTYPE(*FILE)`, noLibList: true }) : Promise.resolve()
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/api/components/getMemberInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class GetMemberInfo implements IBMiComponent {
const tempSourcePath = posix.join(tempDir, `getMemberInfo.sql`);
await connection.getContent().writeStreamfileRaw(tempSourcePath, getSource(connection.getConfig().tempLibrary, this.procedureName, this.currentVersion));
const result = await connection.runCommand({
command: `RUNSQLSTM SRCSTMF('${tempSourcePath}') COMMIT(*NONE) NAMING(*SQL)`,
command: `QSYS/RUNSQLSTM SRCSTMF('${tempSourcePath}') COMMIT(*NONE) NAMING(*SQL)`,
cwd: `/`,
noLibList: true
});
Expand Down
2 changes: 1 addition & 1 deletion src/api/components/getNewLibl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class GetNewLibl implements IBMiComponent {

await connection.getContent().writeStreamfileRaw(tempSourcePath, this.getSource(config.tempLibrary));
const result = await connection.runCommand({
command: `RUNSQLSTM SRCSTMF('${tempSourcePath}') COMMIT(*NONE) NAMING(*SQL)`,
command: `QSYS/RUNSQLSTM SRCSTMF('${tempSourcePath}') COMMIT(*NONE) NAMING(*SQL)`,
cwd: `/`,
noLibList: true
});
Expand Down
8 changes: 4 additions & 4 deletions src/api/tests/suites/asp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function checkAsps(connection: IBMi) {

async function ensureLibExists(connection: IBMi) {
const detail = connection.getIAspDetail(connection.getCurrentIAspName()!)!;
const res = await connection.runCommand({ command: `CRTLIB LIB(${LIBNAME}) ASPDEV(${detail.name})` });
const res = await connection.runCommand({ command: `QSYS/CRTLIB LIB(${LIBNAME}) ASPDEV(${detail.name})` });
if (res.code) {
assert.strictEqual(res.code, 0, res.stderr || res.stdout);
}
Expand All @@ -30,12 +30,12 @@ async function createTempRpgle(connection: IBMi) {
const content = connection.getContent();

await connection.runCommand({
command: `CRTSRCPF ${LIBNAME}/${SPFNAME} MBR(*NONE)`,
command: `QSYS/CRTSRCPF ${LIBNAME}/${SPFNAME} MBR(*NONE)`,
environment: `ile`
});

await connection.runCommand({
command: `ADDPFM FILE(${LIBNAME}/${SPFNAME}) MBR(${MBRNAME}) `,
command: `QSYS/ADDPFM FILE(${LIBNAME}/${SPFNAME}) MBR(${MBRNAME}) `,
environment: `ile`
});

Expand All @@ -59,7 +59,7 @@ describe(`iASP tests`, { concurrent: true }, () => {
}, CONNECTION_TIMEOUT)

afterAll(async () => {
await connection.runCommand({ command: `DLTLIB LIB(${LIBNAME})` });
await connection.runCommand({ command: `QSYS/DLTLIB LIB(${LIBNAME})` });
await disposeConnection(connection);
});

Expand Down
4 changes: 2 additions & 2 deletions src/api/tests/suites/components.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('Component Tests', () => {
tempMbr = `O_ABC`.concat(connection!.variantChars.local);

const result = await connection!.runCommand({
command: `CRTSRCPF ${tempLib}/${tempSPF} MBR(${tempMbr})`,
command: `QSYS/CRTSRCPF ${tempLib}/${tempSPF} MBR(${tempMbr})`,
environment: 'ile'
});
if (result.code === 0) {
Expand All @@ -78,7 +78,7 @@ describe('Component Tests', () => {
finally {
// Cleanup...
await connection!.runCommand({
command: `DLTF ${tempLib}/${tempSPF}`,
command: `QSYS/DLTF ${tempLib}/${tempSPF}`,
environment: 'ile'
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/api/tests/suites/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe(`connection tests`, { concurrent: true }, () => {

it('runCommand (ILE)', async () => {
const result = await connection.runCommand({
command: `DSPJOB OPTION(*DFNA)`,
command: `QSYS/DSPJOB OPTION(*DFNA)`,
environment: `ile`,
getSpooledFiles: true
});
Expand All @@ -141,7 +141,7 @@ describe(`connection tests`, { concurrent: true }, () => {

it('runCommand (ILE, with error)', async () => {
const result = await connection.runCommand({
command: `CHKOBJ OBJ(QSYS/NOEXIST) OBJTYPE(*DTAARA)`,
command: `QSYS/CHKOBJ OBJ(QSYS/NOEXIST) OBJTYPE(*DTAARA)`,
noLibList: true
});

Expand Down Expand Up @@ -230,13 +230,13 @@ describe(`connection tests`, { concurrent: true }, () => {

const result = await CompileTools.runCommand(connection,
{
command: `CRTDTAARA DTAARA(&SCOOBY/TEST) TYPE(*CHAR) LEN(10)`,
command: `QSYS/CRTDTAARA DTAARA(&SCOOBY/TEST) TYPE(*CHAR) LEN(10)`,
environment: `ile`,
env: { '&SCOOBY': `QTEMP` },
},
{
commandConfirm: async (command) => {
expect(command).toBe(`CRTDTAARA DTAARA(QTEMP/TEST) TYPE(*CHAR) LEN(10)`);
expect(command).toBe(`QSYS/CRTDTAARA DTAARA(QTEMP/TEST) TYPE(*CHAR) LEN(10)`);
return command;
}
}
Expand Down
36 changes: 18 additions & 18 deletions src/api/tests/suites/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('Content Tests', { concurrent: true }, () => {
tempMbr = `O_ABC`.concat(connection!.variantChars.local);

const result = await connection!.runCommand({
command: `CRTSRCPF ${tempLib}/${tempSPF} MBR(${tempMbr})`,
command: `QSYS/CRTSRCPF ${tempLib}/${tempSPF} MBR(${tempMbr})`,
environment: 'ile'
});

Expand All @@ -83,7 +83,7 @@ describe('Content Tests', { concurrent: true }, () => {

// Cleanup...
await connection!.runCommand({
command: `DLTF ${tempLib}/${tempSPF}`,
command: `QSYS/DLTF ${tempLib}/${tempSPF}`,
environment: 'ile'
});
});
Expand Down Expand Up @@ -129,7 +129,7 @@ describe('Content Tests', { concurrent: true }, () => {
tempObj = `O_ABC`.concat(connection!.variantChars.local);

await connection!.runCommand({
command: `CRTDTAARA ${tempLib}/${tempObj} TYPE(*CHAR)`,
command: `QSYS/CRTDTAARA ${tempLib}/${tempObj} TYPE(*CHAR)`,
environment: 'ile'
});

Expand All @@ -143,7 +143,7 @@ describe('Content Tests', { concurrent: true }, () => {

// Cleanup...
await connection!.runCommand({
command: `DLTDTAARA ${tempLib}/${tempObj}`,
command: `QSYS/DLTDTAARA ${tempLib}/${tempObj}`,
environment: 'ile'
});
});
Expand Down Expand Up @@ -580,14 +580,14 @@ describe('Content Tests', { concurrent: true }, () => {
const tempLib = connection.getConfig().tempLibrary;
if (tempLib) {
const file = Tools.makeid(8);
const deleteSPF = async () => await connection.runCommand({ command: `DLTF FILE(${tempLib}/${file})`, noLibList: true });
const deleteSPF = async () => await connection.runCommand({ command: `QSYS/DLTF FILE(${tempLib}/${file})`, noLibList: true });
await deleteSPF();
const createSPF = await connection.runCommand({ command: `CRTSRCPF FILE(${tempLib}/${file}) RCDLEN(112)`, noLibList: true });
const createSPF = await connection.runCommand({ command: `QSYS/CRTSRCPF FILE(${tempLib}/${file}) RCDLEN(112)`, noLibList: true });
if (createSPF.code === 0) {
try {
const expectedCount = Math.floor(Math.random() * (10 - 5 + 1)) + 5;
for (let i = 0; i < expectedCount; i++) {
const createMember = await connection.runCommand({ command: `ADDPFM FILE(${tempLib}/${file}) MBR(MEMBER${i}) SRCTYPE(TXT)` });
const createMember = await connection.runCommand({ command: `QSYS/ADDPFM FILE(${tempLib}/${file}) MBR(MEMBER${i}) SRCTYPE(TXT)` });
if (createMember.code) {
throw new Error(`Failed to create member ${tempLib}/${file},MEMBER${i}: ${createMember.stderr}`);
}
Expand Down Expand Up @@ -624,11 +624,11 @@ describe('Content Tests', { concurrent: true }, () => {
const content = connection.getContent()
const longName = Tools.makeid(18);
const shortName = Tools.makeid(8);
const createLib = await connection.runCommand({ command: `RUNSQL 'create schema "${longName}" for ${shortName}' commit(*none)`, noLibList: true });
const createLib = await connection.runCommand({ command: `QSYS/RUNSQL 'create schema "${longName}" for ${shortName}' commit(*none)`, noLibList: true });
if (createLib.code === 0) {
try {
const asp = await connection.lookupLibraryIAsp(shortName);
await connection.runCommand({ command: `CRTSRCPF FILE(${shortName}/SFILE) MBR(MBR) TEXT('Test long library name')` });
await connection.runCommand({ command: `QSYS/CRTSRCPF FILE(${shortName}/SFILE) MBR(MBR) TEXT('Test long library name')` });

const libraries = await content.getLibraries({ library: `${shortName}` });
expect(libraries?.length).toBe(1);
Expand All @@ -650,29 +650,29 @@ describe('Content Tests', { concurrent: true }, () => {

// Add reply list entry to automatically reply to CPA7025 with 'I'
await connection.runCommand({
command: `ADDRPYLE SEQNBR(9999) MSGID(CPA7025) RPY('I')`,
command: `QSYS/ADDRPYLE SEQNBR(9999) MSGID(CPA7025) RPY('I')`,
});

// Change job to use system reply list
await connection.runCommand({
command: `CHGJOB INQMSGRPY(*SYSRPYL)`,
command: `QSYS/CHGJOB INQMSGRPY(*SYSRPYL)`,
});

try {
// Now drop the schema - it will automatically reply to CPA7025
await connection.runCommand({
command: `RUNSQL 'drop schema "${longName}"' commit(*none)`,
command: `QSYS/RUNSQL 'drop schema "${longName}"' commit(*none)`,
noLibList: true
});
} finally {
// Restore job to default inquiry message reply
await connection.runCommand({
command: `CHGJOB INQMSGRPY(*RQD)`,
command: `QSYS/CHGJOB INQMSGRPY(*RQD)`,
});

// Clean up the reply list entry
await connection.runCommand({
command: `RMVRPYLE SEQNBR(9999)`,
command: `QSYS/RMVRPYLE SEQNBR(9999)`,
});
}
}
Expand Down Expand Up @@ -700,15 +700,15 @@ describe('Content Tests', { concurrent: true }, () => {
END_OF_LINE => 'CRLF')`,
);

await connection.runCommand({environment: `ile`, command: `CRTCLMOD MODULE(${tempLib}/${id}) SRCSTMF('${source}')`})
await connection.runCommand({environment: `ile`, command: `QSYS/CRTCLMOD MODULE(${tempLib}/${id}) SRCSTMF('${source}')`})

let exports: ModuleExport[] = await content.getModuleExports(tempLib, id);

expect(exports.length).toBe(1);
expect(exports.at(0)?.symbolName).toBe(id);
} finally {
await connection!.runCommand({
command: `DLTMOD MODULE(${tempLib}/${id})`,
command: `QSYS/DLTMOD MODULE(${tempLib}/${id})`,
environment: 'ile'
});
}
Expand Down Expand Up @@ -744,11 +744,11 @@ describe('Content Tests', { concurrent: true }, () => {
expect(info.at(0)?.symbolName).toBe(id);
} finally {
await connection!.runCommand({
command: `DLTSRVPGM SRVPGM(${tempLib}/${id})`,
command: `QSYS/DLTSRVPGM SRVPGM(${tempLib}/${id})`,
environment: 'ile'
});
await connection!.runCommand({
command: `DLTMOD MODULE(${tempLib}/${id})`,
command: `QSYS/DLTMOD MODULE(${tempLib}/${id})`,
environment: 'ile'
});
}
Expand Down
Loading
Loading