0

I need help with something I'm trying to do and cannot find help anywhere.

I'm trying to upload a file to Host via ISPF (ISPF -> Command -> "Send File to Host"). And the problem I'm having is that the file have variable length (it was exported from a DB2 database via a SH script) and it's not working well.

What I mean is: In windows, the file looks like this:

This is line one
This is the second line
And this is the third

But in Host it always ends being like this:

This is line one This is
the second line and this
is the third

Or similar, depending on the "Record length" I set when allocating the data set.

I don't know if the problem is how I'm creating the file on Host. If the problem is with the send parameters.. or maybe is with the TXT file.

I tried creating the dataset with different Record Formats (F, FB, V, VB) and with all was the same. And also tried modifing the Send parameters in here: Send parameters

And checked the txt file, but it seems to be ok.

Well, thanks in advance for the help! and sorry for my the poor english.

UPDATE 03/18

Hi! I'm still trying to solve this. But now I have a more info!

It seems that problem is within the file exported, not the configuration of the terminal.

I'm using a linux script to export the file from a DB2 database, and I'm trying to upload it from a Windows PC (that have the E3270 terminal). I read a lot, and noticed that the file exported from DB2 to linux only use the "New Line" code to mark an End of Line (0A in hex), while Windows use "Carriage Return + New Line" (which are "0D 0A" in hex).

Could the problem be there?

I tried creating a new txt file with Windows (which end each line with 0D 0A).. and it worked great! But I tried to modify the exported file.. adding an "space" at the end, and then changing that space hex (20) with the 0D (so I had 0D 0A.. it didn't let me "add" a new hexa).. but it didn't work. That.. throw me away the whole theory haha, but maybe I'm doing something wrong.

well, thanks!

1 Answer 1

1

From the Host output the file (dataset) is being considered as fixed length of 24. It needs to be specified as Variable (VB) in the send.

From here Personal Communications 6.0.0>Product Documentation>Books>Emulator User's Reference>Transferring Files it appears that you can specify this as per :-

Record Format

Valid only for VM/CMS and MVS/TSO when APPEND is not specified for file transmission. You can select any of the following:

Default
Fixed (fixed length)
Variable (variable length)
Undefined (undefined mode for MVS/TSO only)

If you select the Default value, the record format is selected automatically by the host system.

Specifying Variable for VM file transfer enables host disk space to be used efficiently. Logical Record Length (LRECL)

Valid only for VM/CMS and MVS/TSO when APPEND is not specified for file transmission.

Enter the logical record length to be used (host record byte count) in the LRECL text box. If Variable and Undefined Mode are specified as the record format, the logical record length is the maximum record length within a file. The maximum value is 32767.

The record length of a file sent from a workstation to the host system might exceed the logical record length specified here. If so, the host file transfer program divides the file by the logical record length.

When sending a text file from a workstation to a host, if the text file contains 2-byte workstation codes (such as kanji codes), the record length of the file is changed because SO and SI have been inserted.

To send a file containing long records to the host system, specify a sufficiently long logical record length.

Because the record length of a workstation file exceeds the logical record length, a message does not appear normally if each record is divided. To display a message, add the following specification to the [Transfer] item of the workstation profile:

DisplayTruncateMessage = Y

As I don't have access I can't actually look into this further but I do recall that it can be a little confusing to use the file transfer.

I'd suggest using the 32767 as the LRECL, along with variable, and perhaps having a look at the whole page that has been linked. Something on the PC side will have to know how to convert the file (ie at LF determine the length of the record and prefix the record with that record length (if I recall correctly 2 bytes/a word)) so you might have to use variable in conjunction with another selectable parameter.

If you follow the link, you will see that Record Format is part of the Defining Transfer Types, you may have to define a transfer type as per :-

Click Edit -> Preferences -> Transfer from the session window.
Click the tab for your host type or modem protocol.

The property page for the selected host or modem protocol opens. The items that appear depend on the selected host system.
Enter transfer-type names in the Transfer Type box, or select them from the drop-down list.
Select or enter the required items (see Items to Be Specified).

To add or replace a transfer type, click Save. To delete a transfer type, click Delete.
A dialog box displays, asking for confirmation. Click OK.
5
  • 2
    I'd go with 255 as the LRECL, as that is the longest LRECL supported by ISPF edit. Also, the maximum LRECL for a VB data set is 32756, as 32760 is the maximum non-VSAM non-EXCP block size. Commented Mar 15, 2016 at 4:17
  • @zarc What you say seems to have rattled the old grey matter, so good advice.
    – MikeT
    Commented Mar 15, 2016 at 5:41
  • 32767 is the maximum LRECL for fixed-length records. The LRECL should always be long enough for the maximum data and such that any program reading the data will operate (COBOL will moan if the LRECL of a dataset is longer than the program expects, for instance). Commented Mar 15, 2016 at 10:18
  • Great, thanks everyone! I will read all of that and try a few things a let you know what happens. (Y)
    – Buki
    Commented Mar 15, 2016 at 15:00
  • I added some more info to the post in "UPDATE 03/18"! :D
    – Buki
    Commented Mar 18, 2016 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.