sftp to Mainframe host

吃可爱长大的小学妹 提交于 2019-12-11 05:13:53

问题


Right now i'm kinda confused. When I want to exchange data between a PC and the Mainframe host via sftp, what are necessary steps to realise this.

as far as I know I can't connect directly to the host. People told me that there is something like an OMVS environment and I have to send the files first to this environment to get the data from the server via sftp.(z/os is used and running)

Is this right? And what is OMVS? and what steps are necessary to exchange files between host and OMVS? Or are there better solutions?

Thanks in advance


回答1:


And what is OMVS?

OMVS is short for Open MVS. z/OS is Unix; you can think of it as a Unix that includes all that ancestral OS/360, MVS, and z/OS stuff developed over the last half century. OMVS is also called Unix System Services. It's not a separate operating system, it's not running in a separate LPAR or VM. It is a separate file system that you deal with, one that conforms to Unix conventions. So it's got directories and is case sensitive and has attribute bits.

You can type OMVS at a TSO READY prompt to get a 3270 flavored Unix shell. You can use PuTTY to connect to a z/OS host for a more standard Unix shell.

what steps are necessary to exchange files between host and OMVS? Or are there better solutions?

It depends. Dovetailed Technologies Co:Z SFTP server has extensions that allow transfer of standard z/OS datasets directly to/from a z/OS host.

If your technical people insist on going through the OMVS file system, then you will need mainframe security credentials with an OMVS segment defined to RACF (or whichever ESM your shop uses). The OMVS segment specifies, among other things, your OMVS home directory.

Transferring files between your PC and z/OS via sftp may involve code page translation. This can be tricky.

It is common for mainframe data to include both text and binary data in a single record, for example a name, a currency amount, and a quantity:

Hopper Grace ar% .

...which would be...

x'C8969797859940404040C799818385404040404081996C004B'

...in hex. This is code page 37, commonly referred to as EBCDIC.

Without knowing that the family name is confined to the first 10 bytes, the given name confined the the subsequent 10 bytes, the currency amount is in packed decimal (also known as binary coded decimal) in the next 3 bytes, and the quantity in the next two bytes, you cannot accurately transfer the data because code page conversion will destroy the currency amount. Converting to code page 1250, commonly in use on Microsoft Windows, you would end up with...

x'486F707065722020202047726163652020202020617225002E'

...where the text data is translated but the packed data is destroyed. The packed data no longer has a valid sign in the last nibble (the lower half of the last byte), the currency amount itself has been changed as has the quantity (from decimal 75 to decimal 11,776 due to both code page conversion and mangling of a big endian number as a little endian number).

One solution is to only transfer data that is in text format. Mainframe sort utilities typically excel at data transformations. This does entail an extra step on the z/OS side if your file contains packed or binary data.

Another solution, if you are transferring data from z/OS to another platform for processing, is to use the JRecord library to process the data.

Is the data you wish to access covered by privacy legislation? You may have to provide some evidence that whatever protections are in place to guarantee that only authorized personnel have access to this data in its current location are also in place once you have transferred it to its target destination. Such guarantees may have to satisfy an auditor.

Transferring data to and from the OMVS file system can be done with the Unix cp command. On z/OS this command has extensions to let it understand both "classic" z/OS datasets and OMVS files.

The cp command can be executed either from a shell prompt or via a standard z/OS batch job (JCL) executing BPXBATCH, whichever fits into your workflow.

Once the file has been copied to a directory in the OMVS file system to which you have access, just use sftp like you normally would to transfer the file to your PC.

When I want to exchange data between a PC and the Mainframe host via sftp, what are necessary steps to realise this.

Initial setup...

  1. Obtain mainframe credentials with an OMVS segment.
  2. Obtain a directory in which to place the OMVS file. This directory must have appropriate security for the contents of the file.
  3. Optionally, have a mainframe person create a job step to transform any packed and binary data to text format.

Each time you wish to transfer the file...

  1. Optionally, execute the transform step created in #3 above.
  2. Copy the file to the directory set up in #2 above.
  3. Use your favorite sftp client to transfer the file to your PC.

If this is something you're going to do on a regular basis, steps 1 and 2 could be part of a scheduled batch job so the file is always present in the directory when you want it. This something to negotiate with your production control staff.



来源:https://stackoverflow.com/questions/46303875/sftp-to-mainframe-host

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!