Skip to content

Commit 154bc1b

Browse files
authored
Merge pull request #3125 from codefori/additional-elk
Use QSYS prefix on all system commands
2 parents d4fdfb8 + 34ed28f commit 154bc1b

File tree

18 files changed

+104
-104
lines changed

18 files changed

+104
-104
lines changed

src/api/IBMi.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ export default class IBMi {
634634
});
635635

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

680680

681681
const QCPTOIMPF = await this.runCommand({
682-
command: `CHKOBJ OBJ(QSYS/QCPTOIMPF) OBJTYPE(*DTAARA)`,
682+
command: `QSYS/CHKOBJ OBJ(QSYS/QCPTOIMPF) OBJTYPE(*DTAARA)`,
683683
noLibList: true
684684
});
685685

@@ -688,7 +688,7 @@ export default class IBMi {
688688
}
689689

690690
const QCPFRMIMPF = await this.runCommand({
691-
command: `CHKOBJ OBJ(QSYS/QCPFRMIMPF) OBJTYPE(*DTAARA)`,
691+
command: `QSYS/CHKOBJ OBJ(QSYS/QCPFRMIMPF) OBJTYPE(*DTAARA)`,
692692
noLibList: true
693693
})
694694

@@ -1017,7 +1017,7 @@ export default class IBMi {
10171017
}
10181018

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

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

src/api/IBMiContent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export default class IBMiContent {
314314
if (this.config.autoClearTempData) {
315315
Promise.allSettled([
316316
this.ibmi.sendCommand({ command: `rm -rf ${tempRmt}`, directory: `.` }),
317-
deleteTable ? this.ibmi.runCommand({ command: `DLTOBJ OBJ(${library}/${file}) OBJTYPE(*FILE)`, noLibList: true }) : Promise.resolve()
317+
deleteTable ? this.ibmi.runCommand({ command: `QSYS/DLTOBJ OBJ(${library}/${file}) OBJTYPE(*FILE)`, noLibList: true }) : Promise.resolve()
318318
]);
319319
}
320320

src/api/components/getMemberInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class GetMemberInfo implements IBMiComponent {
3939
const tempSourcePath = posix.join(tempDir, `getMemberInfo.sql`);
4040
await connection.getContent().writeStreamfileRaw(tempSourcePath, getSource(connection.getConfig().tempLibrary, this.procedureName, this.currentVersion));
4141
const result = await connection.runCommand({
42-
command: `RUNSQLSTM SRCSTMF('${tempSourcePath}') COMMIT(*NONE) NAMING(*SQL)`,
42+
command: `QSYS/RUNSQLSTM SRCSTMF('${tempSourcePath}') COMMIT(*NONE) NAMING(*SQL)`,
4343
cwd: `/`,
4444
noLibList: true
4545
});

src/api/components/getNewLibl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class GetNewLibl implements IBMiComponent {
3939

4040
await connection.getContent().writeStreamfileRaw(tempSourcePath, this.getSource(config.tempLibrary));
4141
const result = await connection.runCommand({
42-
command: `RUNSQLSTM SRCSTMF('${tempSourcePath}') COMMIT(*NONE) NAMING(*SQL)`,
42+
command: `QSYS/RUNSQLSTM SRCSTMF('${tempSourcePath}') COMMIT(*NONE) NAMING(*SQL)`,
4343
cwd: `/`,
4444
noLibList: true
4545
});

src/api/tests/suites/asp.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function checkAsps(connection: IBMi) {
2020

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

3232
await connection.runCommand({
33-
command: `CRTSRCPF ${LIBNAME}/${SPFNAME} MBR(*NONE)`,
33+
command: `QSYS/CRTSRCPF ${LIBNAME}/${SPFNAME} MBR(*NONE)`,
3434
environment: `ile`
3535
});
3636

3737
await connection.runCommand({
38-
command: `ADDPFM FILE(${LIBNAME}/${SPFNAME}) MBR(${MBRNAME}) `,
38+
command: `QSYS/ADDPFM FILE(${LIBNAME}/${SPFNAME}) MBR(${MBRNAME}) `,
3939
environment: `ile`
4040
});
4141

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

6161
afterAll(async () => {
62-
await connection.runCommand({ command: `DLTLIB LIB(${LIBNAME})` });
62+
await connection.runCommand({ command: `QSYS/DLTLIB LIB(${LIBNAME})` });
6363
await disposeConnection(connection);
6464
});
6565

src/api/tests/suites/components.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('Component Tests', () => {
6262
tempMbr = `O_ABC`.concat(connection!.variantChars.local);
6363

6464
const result = await connection!.runCommand({
65-
command: `CRTSRCPF ${tempLib}/${tempSPF} MBR(${tempMbr})`,
65+
command: `QSYS/CRTSRCPF ${tempLib}/${tempSPF} MBR(${tempMbr})`,
6666
environment: 'ile'
6767
});
6868
if (result.code === 0) {
@@ -78,7 +78,7 @@ describe('Component Tests', () => {
7878
finally {
7979
// Cleanup...
8080
await connection!.runCommand({
81-
command: `DLTF ${tempLib}/${tempSPF}`,
81+
command: `QSYS/DLTF ${tempLib}/${tempSPF}`,
8282
environment: 'ile'
8383
});
8484
}

src/api/tests/suites/connection.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe(`connection tests`, { concurrent: true }, () => {
130130

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

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

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

231231
const result = await CompileTools.runCommand(connection,
232232
{
233-
command: `CRTDTAARA DTAARA(&SCOOBY/TEST) TYPE(*CHAR) LEN(10)`,
233+
command: `QSYS/CRTDTAARA DTAARA(&SCOOBY/TEST) TYPE(*CHAR) LEN(10)`,
234234
environment: `ile`,
235235
env: { '&SCOOBY': `QTEMP` },
236236
},
237237
{
238238
commandConfirm: async (command) => {
239-
expect(command).toBe(`CRTDTAARA DTAARA(QTEMP/TEST) TYPE(*CHAR) LEN(10)`);
239+
expect(command).toBe(`QSYS/CRTDTAARA DTAARA(QTEMP/TEST) TYPE(*CHAR) LEN(10)`);
240240
return command;
241241
}
242242
}

src/api/tests/suites/content.test.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('Content Tests', { concurrent: true }, () => {
6262
tempMbr = `O_ABC`.concat(connection!.variantChars.local);
6363

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

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

8484
// Cleanup...
8585
await connection!.runCommand({
86-
command: `DLTF ${tempLib}/${tempSPF}`,
86+
command: `QSYS/DLTF ${tempLib}/${tempSPF}`,
8787
environment: 'ile'
8888
});
8989
});
@@ -129,7 +129,7 @@ describe('Content Tests', { concurrent: true }, () => {
129129
tempObj = `O_ABC`.concat(connection!.variantChars.local);
130130

131131
await connection!.runCommand({
132-
command: `CRTDTAARA ${tempLib}/${tempObj} TYPE(*CHAR)`,
132+
command: `QSYS/CRTDTAARA ${tempLib}/${tempObj} TYPE(*CHAR)`,
133133
environment: 'ile'
134134
});
135135

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

144144
// Cleanup...
145145
await connection!.runCommand({
146-
command: `DLTDTAARA ${tempLib}/${tempObj}`,
146+
command: `QSYS/DLTDTAARA ${tempLib}/${tempObj}`,
147147
environment: 'ile'
148148
});
149149
});
@@ -580,14 +580,14 @@ describe('Content Tests', { concurrent: true }, () => {
580580
const tempLib = connection.getConfig().tempLibrary;
581581
if (tempLib) {
582582
const file = Tools.makeid(8);
583-
const deleteSPF = async () => await connection.runCommand({ command: `DLTF FILE(${tempLib}/${file})`, noLibList: true });
583+
const deleteSPF = async () => await connection.runCommand({ command: `QSYS/DLTF FILE(${tempLib}/${file})`, noLibList: true });
584584
await deleteSPF();
585-
const createSPF = await connection.runCommand({ command: `CRTSRCPF FILE(${tempLib}/${file}) RCDLEN(112)`, noLibList: true });
585+
const createSPF = await connection.runCommand({ command: `QSYS/CRTSRCPF FILE(${tempLib}/${file}) RCDLEN(112)`, noLibList: true });
586586
if (createSPF.code === 0) {
587587
try {
588588
const expectedCount = Math.floor(Math.random() * (10 - 5 + 1)) + 5;
589589
for (let i = 0; i < expectedCount; i++) {
590-
const createMember = await connection.runCommand({ command: `ADDPFM FILE(${tempLib}/${file}) MBR(MEMBER${i}) SRCTYPE(TXT)` });
590+
const createMember = await connection.runCommand({ command: `QSYS/ADDPFM FILE(${tempLib}/${file}) MBR(MEMBER${i}) SRCTYPE(TXT)` });
591591
if (createMember.code) {
592592
throw new Error(`Failed to create member ${tempLib}/${file},MEMBER${i}: ${createMember.stderr}`);
593593
}
@@ -624,11 +624,11 @@ describe('Content Tests', { concurrent: true }, () => {
624624
const content = connection.getContent()
625625
const longName = Tools.makeid(18);
626626
const shortName = Tools.makeid(8);
627-
const createLib = await connection.runCommand({ command: `RUNSQL 'create schema "${longName}" for ${shortName}' commit(*none)`, noLibList: true });
627+
const createLib = await connection.runCommand({ command: `QSYS/RUNSQL 'create schema "${longName}" for ${shortName}' commit(*none)`, noLibList: true });
628628
if (createLib.code === 0) {
629629
try {
630630
const asp = await connection.lookupLibraryIAsp(shortName);
631-
await connection.runCommand({ command: `CRTSRCPF FILE(${shortName}/SFILE) MBR(MBR) TEXT('Test long library name')` });
631+
await connection.runCommand({ command: `QSYS/CRTSRCPF FILE(${shortName}/SFILE) MBR(MBR) TEXT('Test long library name')` });
632632

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

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

656656
// Change job to use system reply list
657657
await connection.runCommand({
658-
command: `CHGJOB INQMSGRPY(*SYSRPYL)`,
658+
command: `QSYS/CHGJOB INQMSGRPY(*SYSRPYL)`,
659659
});
660660

661661
try {
662662
// Now drop the schema - it will automatically reply to CPA7025
663663
await connection.runCommand({
664-
command: `RUNSQL 'drop schema "${longName}"' commit(*none)`,
664+
command: `QSYS/RUNSQL 'drop schema "${longName}"' commit(*none)`,
665665
noLibList: true
666666
});
667667
} finally {
668668
// Restore job to default inquiry message reply
669669
await connection.runCommand({
670-
command: `CHGJOB INQMSGRPY(*RQD)`,
670+
command: `QSYS/CHGJOB INQMSGRPY(*RQD)`,
671671
});
672672

673673
// Clean up the reply list entry
674674
await connection.runCommand({
675-
command: `RMVRPYLE SEQNBR(9999)`,
675+
command: `QSYS/RMVRPYLE SEQNBR(9999)`,
676676
});
677677
}
678678
}
@@ -700,15 +700,15 @@ describe('Content Tests', { concurrent: true }, () => {
700700
END_OF_LINE => 'CRLF')`,
701701
);
702702

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

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

707707
expect(exports.length).toBe(1);
708708
expect(exports.at(0)?.symbolName).toBe(id);
709709
} finally {
710710
await connection!.runCommand({
711-
command: `DLTMOD MODULE(${tempLib}/${id})`,
711+
command: `QSYS/DLTMOD MODULE(${tempLib}/${id})`,
712712
environment: 'ile'
713713
});
714714
}
@@ -744,11 +744,11 @@ describe('Content Tests', { concurrent: true }, () => {
744744
expect(info.at(0)?.symbolName).toBe(id);
745745
} finally {
746746
await connection!.runCommand({
747-
command: `DLTSRVPGM SRVPGM(${tempLib}/${id})`,
747+
command: `QSYS/DLTSRVPGM SRVPGM(${tempLib}/${id})`,
748748
environment: 'ile'
749749
});
750750
await connection!.runCommand({
751-
command: `DLTMOD MODULE(${tempLib}/${id})`,
751+
command: `QSYS/DLTMOD MODULE(${tempLib}/${id})`,
752752
environment: 'ile'
753753
});
754754
}

0 commit comments

Comments
 (0)