vscode-extension-for-zowe icon indicating copy to clipboard operation
vscode-extension-for-zowe copied to clipboard

Could ZoweExplorerApi.IMvs also have "Get.dataSet()" ?

Open travatine opened this issue 4 years ago • 4 comments

Hi,

The ZOSMF / Zowe "Get,dataSet()" function allowed the contents of a dataset to be downloaed to a buffer. It'd be great if we could do the same via the "ZoweExplorerApi.IMvs" interace / api.

travatine avatar Apr 16 '20 07:04 travatine

Hi, I still am interested in a Get.dataset api, is there any way to get this added at some point in the future?

travatine avatar Jun 22 '20 08:06 travatine

Hi,

Currently I use the Get.dataSet() api to "get the contents of a small dataset" as string. The data set contains UTF-8 test data.

async function getDataSetAsString(profile: IProfileLoaded, dsn: string): Promise<string> {
  const session = await  ZosmfSession.createBasicZosmfSession(profile.profile);
  const response = await Get.dataSet(session, dsn,  binary: true })); 
 return response.toString();
}

I use this API as a local temporary file is not required and does not have to be subsequently deleted.

travatine avatar Nov 02 '20 05:11 travatine

Hi @travatine, we have the dataset function implemented as an API. Kindly check if this suits your needs and if we can close this issue. Thanks!

crawr avatar Mar 02 '21 16:03 crawr

Hi,

I needed to download a file to a string, that API function uses a temporary file rather than a string.

Could a function to download a file to string please be added to the dataset API?

Thanks

travatine avatar Mar 02 '21 23:03 travatine

Hi @travatine ! is the use case for this to enhance Zowe Explorer to be able to download a data set through a right-click for example or to have this call to get a dataset into our API?

If the case is the second one, I believe the following should fufill your need for downloading a file to a string in the dataset API:

public getContents(dataSetName: string, options?: zowe.IDownloadOptions): Promise<zowe.IZosFilesResponse> {
        return zowe.Download.dataSet(this.getSession(), dataSetName, options);
}

rudyflores avatar Mar 14 '23 14:03 rudyflores

Thank you for raising this issue. The community has 90 days to upvote 👍 the issue. If it receives 10 upvotes, we will move it to our backlog. If not, we will close it.

github-actions[bot] avatar Mar 14 '23 15:03 github-actions[bot]

Thanks @rudyflores

travatine avatar Mar 14 '23 23:03 travatine