如何在 VBA 中为 IBM 大型机/FTP 创建固定阻止 (FB) 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2251087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 11:19:37  来源:igfitidea点击:

How to create a fixed blocked (FB) file for IBM mainframe/FTP in VBA

vbablockingmainframe

提问by Bazily

I've got VBA code that generates a text file with some pretty basic information included. I then upload that file via FTP.

我有 VBA 代码,它生成一个文本文件,其中包含一些非常基本的信息。然后我通过 FTP 上传该文件。

I got a message from the server admin of the IBM mainframe today that my file was in variable blocking (VB) format and their job process uses a fixed blocking (FB) up to a max size of 256.

今天我从 IBM 大型机的服务器管理员那里收到一条消息,我的文件是可变阻塞 (VB) 格式,他们的作业进程使用固定阻塞 (FB),最大大小为 256。

How is this done? During the file creation? 3rd party tool?

这是怎么做的?在文件创建期间?第三方工具?

B

回答by nakul raj

You can simply convert the VB file into FB in mainframe before running the actual process.VB to FB conversion JCLis a small JCL step to do your conversion

在运行实际过程之前,您可以简单地在大型机中将 VB 文件转换为 FB。VB 到 FB 转换 JCL是一个小的 JCL 步骤来做你的转换

回答by t0mm13b

If I rightly remember FB is in multiples of the block sizes, that is just how DASDstores the files on disk, it must fit in that multiple block size, which increases speed and throughput on the Mainframe. If the data file is not within the boundary of multiple block sizes (This has nothing to do with the actual size of the data), the DASD system just access files in blocks of 256 bytes...there will be a host of special fields inserted into the data file to describe the blocking and so on...which will get inserted when transferred to the mainframe and that data gets transferred to magnetic tape backups...

如果我正确地记得 FB 是块大小的倍数,这就是DASD将文件存储在磁盘上的方式,它必须适合多个块大小,这会提高大型机的速度和吞吐量。如果数据文件不在多个块大小的边界内(这与数据的实际大小无关),DASD系统只是以256字节的块访问文件......会有大量特殊字段插入到数据文件中以描述阻塞等等......当传输到大型机时将被插入并且数据被传输到磁带备份......

There should be a script available on the Mainframe to convert it using JCL (Job Control Language)..ask the Mainframe administrator to do it for you...

大型机上应该有一个脚本可用,可以使用 JCL(作业控制语言)进行转换。请大型机管理员为您执行此操作...

By the way it should be noted that the character set you used in your data file, just be aware that the mainframe uses EBCDICcharacter set...There are plenty of tools out there that can convert from ASCII data to the format to be readable by the mainframe, just something to bear in mind of...If the data gets converted that could impact the file size...Thought it would be worth mentioning and important!

顺便说一下,您在数据文件中使用的字符集,请注意大型机使用EBCDIC字符集...有很多工具可以将 ASCII 数据转换为可读格式通过大型机,需要记住的事情......如果数据被转换,可能会影响文件大小......认为这将是值得一提和重要的!

There is a Unix/Linux utility that can convert the data to a fixed block size using the ddutility, although I do not think it would be the right way to do it...

有一个 Unix/Linux 实用程序可以使用该dd实用程序将数据转换为固定的块大小,尽管我认为这不是正确的方法......

Here's a useful link that will help you in understanding this. And also here on SOa similar user was asking about MVS/TSO data...

这是一个有用的链接,可以帮助您理解这一点。同样在SO 上,一个类似的用户正在询问 MVS/TSO 数据......

回答by kishore

You can use Locsite to set the record format on the host dataset(File). You can find all the list of FTP sub commands in the below user guide

您可以使用 Locsite 在主机数据集(文件)上设置记录格式。您可以在以下用户指南中找到所有 FTP 子命令列表

IP User's Guide and Commands SC31-8780-05

IP 用户指南和命令SC31-8780-05

回答by Bazily

Sorry all, I have a feeling I didn't explain this correctly, because I do now have an answer which is rather simple. These 2 commands seemed to have setup the environment correctly for the file to be fb and not vb.

对不起,我觉得我没有正确解释这一点,因为我现在确实有一个相当简单的答案。这 2 个命令似乎已经为文件正确设置了环境为 fb 而不是 vb。

ftp> quote site lr=94
ftp> quote site rec=fb