-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dasdseq enhancement request #614
Comments
Hi Gregory! That sounds like a really good idea! I will try to get started on making that change for you right away! Thank you for suggesting it! (Note: it might take me a little while to complete, as I am currently busy with other things at the same time, but I will let you know when I am done so you can test it.) |
Gregory (@GregoryTwin), SOME QUESTIONS:
Thanks. |
Thank you very much for your attention to the request! Please see my thoughts below:
Let me try to explain once more. RECFM=F and RECFM=V datasets could be used when transferred in binary mode, because in both cases we are able split the data stream into records to restore the original record (when F, just split by LRECL, when V, split using record length kept in the record descriptor BDW & RDW). So, |
(Oops!) I'm completely wrong with point 3 above! Sorry for that! I've just tried ftp:
It works for ascii mode too! I got translated records prefixed with x'800050'. So, probably would be better to allow -block mode with -ascii, to provide the same beheaviour as ftp. |
I've also noticed that the last block of data transferred in "block mode" is prefixed with x'40....' rather than x'80....'. So I had a look at section 3.4.2 on page 21-22 of RFC959 (File Transfer Protocol): 3.4.2. BLOCK MODE The file is transmitted as a series of data blocks preceded by one or more header bytes. The header bytes contain a count field, and descriptor code. The count field indicates the total length of the data block in bytes, thus marking the beginning of the next data block (there are no filler bits). The descriptor code defines: last block in the file (EOF) last block in the record (EOR), restart marker (see the Section on Error Recovery and Restart) or suspect data (i.e., the data being transferred is suspected of errors and is not reliable). This last code is NOT intended for error control within FTP. It is motivated by the desire of sites exchanging certain types of data (e.g., seismic or weather data) to send and receive all the data despite local errors (such as "magnetic tape read errors"), but to indicate in the transmission that certain portions are suspect). Record structures are allowed in this mode, and any representation type may be used. The header consists of the three bytes. Of the 24 bits of header information, the 16 low order bits shall represent byte count, and the 8 high order bits shall represent descriptor codes as shown below. Block Header +----------------+----------------+----------------+ | Descriptor | Byte Count | | 8 bits | 16 bits | +----------------+----------------+----------------+ The descriptor codes are indicated by bit flags in the descriptor byte. Four codes have been assigned, where each code number is the decimal value of the corresponding bit in the byte. Code Meaning 128 End of data block is EOR 64 End of data block is EOF 32 Suspected errors in data block 16 Data block is a restart marker With this encoding, more than one descriptor coded condition may exist for a particular block. As many bits as necessary may be flagged. The restart marker is embedded in the data stream as an integral number of 8-bit bytes representing printable characters in the language being used over the control connection (e.g., default--NVT-ASCII). (Space, in the appropriate language) must not be used WITHIN a restart marker. For example, to transmit a six-character marker, the following would be sent: +--------+--------+--------+ |Descrptr| Byte count | |code= 16| = 6 | +--------+--------+--------+ +--------+--------+--------+ | Marker | Marker | Marker | | 8 bits | 8 bits | 8 bits | +--------+--------+--------+ +--------+--------+--------+ | Marker | Marker | Marker | | 8 bits | 8 bits | 8 bits | +--------+--------+--------+ I suppose, descriptors 32 and 16 (x'20' and x'10') not applicable in our particular case. |
Thank you for the clarification!
Nope. We're both wrong. After reviewing (looking closely at) dasdseq's code (logic), it appears the "-ascii" option does not write any data whatsoever to the output file! Rather, it simply displays the records on the Hercules console! (as a Hercules message). The output file is never written to. No I suppose we could change that behavior, but I would rather not. It appears the original author purposely designed dasdseq that way. They just didn't document it that well. |
Thank you! But I am still confused about the X'40' EOF flag. The way Should the EOF flag be used on the last record of each block? Or only on the last record of the very last block? I presume it should be the latter? Yes? Only when EOF is reached on the dataset, yes? (i.e. only at the end of the very last block of the dataset? Yes?) The reason I'm asking is because, by using it at the end of every block, it allows to determine the end of each block (i.e. the blocking factor). That is to say, if the file is RECFM=FB LRECL=80 BLKSIZE=27920 and contains, say 3500 records, that would consist of 10 blocks of 27920 bytes (349 records in each block), with the last block being only 800 bytes (final 10 records). If the EOF flag was used on the last record of each block (i.e. every 349 records), then it would be easy to determine the size of each block. (The EOF flag would mark the end of each block). It seems unnecessary to set the EOF flag only when EOF is reached on the dataset! We know EOF has been reached because there is no more data in the file! Duh! So I would appreciate clarification on this. Thanks. |
According to RFC959, only the very last block should have the X'40' EOF flag. All other blocks should have just the X'80' EOR flag. To confirm this, I downloaded a LRECL=80 BLKSIZE=27920 dataset to my PC using "quote mode b", and as expected, only very last record was marked with x'40'. Being interested in how important this EOF flag might be, I then updated the last record of the downloaded file, replacing the x'40' with x'80' instead, and then tried uploading it back to the MF using "quote mode b". The upload was successful. So, I believe, this EOF flag is just an informal requirement of RFC959. FTP apparently processes a file normally having x'80' anywhere in its data, including in the very last record. |
Good! Because supporting it (the X'40' EOF flag) would complicate the existing logic in I will make the change right away. Thanks for all your help, Gregory! |
Implemented in commit 179ba63. Feel free to give it a try! Closing. |
Thank you very much! Also thank you for correcting my English, this is useful for me. |
You're very welcome! Please keep in mind however, that my own English is not perfect! |
At the moment,
dasdseq
is able to extract data from a z/OS sequential dataset using either ASCII or binary mode. However, binary mode can only be used for a very limited number and type of datasets, like TSO TRANSMIT results for example, since record boundaries would otherwise be lost if ASCII mode were to be used.I propose implementing a third
dasdseq
mode, called e.g. "RECORD" or "BLOCK' mode. This would be the same type of mode that FTP currently uses when'quote mode b'
is specified when uploading or downloading a file, where each data block is simply prefixed with x'80' followed by a 2-byte block length.Using this new
dasdseq
extraction mode, the ease and speed at which transferring datasets between Hercules and a real mainframe could be dramatically improved:ADRDSSU
to dump any data to a sequential dataset.dasdseq
, we could then extract that sequential dataset to a host system file.ADRDSSU
.We can of course currently accomplish the thing today, but it unfortunately takes two separate FTPs in order to do so:
ADRDSSU
to dump any data to a sequential dataset.ADRDSSU
.Given how slow FTP is compared to
dasdseq
(especially for large datasets), this newdasdseq
extraction mode would thus allow datasets to be uploaded or downloaded to/from real mainframes much more quickly and easily than without it.The text was updated successfully, but these errors were encountered: