Skip to content

Commit

Permalink
fix: add start to numRecords parm (if provided)
Browse files Browse the repository at this point in the history
Signed-off-by: Trae Yelovich <[email protected]>
  • Loading branch information
traeok committed Dec 27, 2024
1 parent 30293ad commit 2a48498
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/zosjobs/src/DownloadJobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ export class DownloadJobs {

const headers = [Headers.TEXT_PLAIN_UTF8];
if (parms.startRecord || parms.numRecords) {
headers.push({ [ZosmfHeaders.X_IBM_RECORD_RANGE]: `${parms.startRecord ?? 0}-${parms.numRecords ?? 0}` });
const start = parms.startRecord ?? 0;
const numRecords = parms.numRecords ? start + parms.numRecords : 0;
headers.push({ [ZosmfHeaders.X_IBM_RECORD_RANGE]: `${start}-${numRecords}` });
}

const writeStream = parms.stream ?? IO.createWriteStream(file);
Expand Down

0 comments on commit 2a48498

Please sign in to comment.