W dniu 24.10.2024 o 09:17, Jason Cai pisze:
Hi  all

  I followed these procedures:

1. Created a Variable-Length Dataset on the Mainframe

Dataset Name: TEST.DATA1
Logical Record Length (LRECL): 10
Record Format :VB
Content: The dataset contains 2 records:

000001 AAA
000002 BB

2. Downloaded the Dataset to Linux

Using an FTP  on the z/OS platform, I downloaded the dataset to Linux with the 
following commands:


ftp -v -n <<EOF
open [linux_server_address]
user [username] [password]
prompt
binary
locsite rdw
put TEST.DATA1
close
bye

3. Uploaded the File Back to the Mainframe from Linux

On a Linux platform, I attempted to upload the file back to the mainframe using 
the following FTP commands:


ftp -v -n <<EOF
open [mainframe_address]
user [username] [password]
prompt
binary
quote site rdw recfm=vb lrecl=10
put TEST.DATA1 TEST.DATA2
close
bye
EOF

Problem Statement

   I expected TEST.DATA2 to be identical to TEST.DATA1, but the RDWs were 
misinterpreted, resulting in incorrect data.
   How can I correctly FTP a variable-length file to the mainframe so that the 
uploaded dataset matches the original?

Could you please provide guidance on the correct procedure to FTP a 
variable-length file to the mainframe, ensuring that the dataset on the 
mainframe is restored to its original format?

  I don't know where I went wrong in step 3. Uploaded the File Back to the 
Mainframe from Linux.

Any suggestions and help would be greatly appreciated


Few remarks
1. You *CANNOT* upload "variable-length file" [from Linux] to the mainframe. You can upload *just a file* from Linux to z/OS. A file on Linux has no structure, it is "byte oriented", which means no records, just ordered set of bytes. Of course we know "file formats" like XLS, or PDF, etc. but it is up to the application to interpret the set of bytes.

2. You may want to upload text file, with some end of line control character, like CRLF or just LF. Usually we want to change end of line characters to records.

3. When you download text dataset to Linux/Windows you may want to translate record boundaries to LF/CRLF characters.

4. Caution: z/OS environment (i.e. ISPF editor) tend to cut ending spaces (X'40 EBCDIC) and then change record length. That can be a source of discrepancies. Is it important? Usually not.

5. If you really want to transfer (only transfer, no changes!) using Linux platform then you can simply pack your file into some envelope. IMHO the simplest method is to use XMIT. Then you can transfer XMIT-packed file wherever you want and finally un-XMIT (RECEIVE) the original content. However I guess there is something to change on Linux side. :-)

HTH

--
Radoslaw Skorupka
Lodz, Poland

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to