IBM Z and LinuxONE IBM Z

IBM Z

The enterprise platform for mission-critical applications brings next-level data privacy, security, and resiliency to your hybrid multicloud.

 View Only
Expand all | Collapse all

FTP throws Invalid DSORG when doing a PUT

  • 1.  FTP throws Invalid DSORG when doing a PUT

    Posted Thu August 12, 2021 12:35 PM
    I am doing a binary file transfer from a PC to the z/OS FTP server. Since it is a binary transfer, the records are fixed length, so I pre-allocate the file so that it will be properly divided into records on the mainframe. I used JCL to allocate the file, but nothing is loaded into the file. When I send the file, I get a message back that says the file has an invalid DSORG.

    When I look at the file in TSO, it shows the Record Format show FB. If I do a DIR from FTP, the DSORG is ?.  If I delete and allocate the file in TSO, then FTP sees the DSORG as FB and everything is fine. The problem is doing the allocate in JCL that somehow leaves the file in some sort of mixed state where TSO sees FB and FTP doesn't know what it is.

    My work around is to allocate the file then write a dummy record to it. This seems to set the DSORG to FB when FTP sees it, and since I am replacing the file, it works out.

    Here is what I use to allocate the file:

    //TMP757A DD DSN=CMP.R004.@@.HLP9901.UPLD,
    // DISP=(NEW,CATLG,DELETE),
    // DCB=(RECFM=FB,LRECL=4024,BLKSIZE=16096),
    // SPACE=(CYL,(18,1),RLSE),
    // UNIT=SYSDA,VOL=SER=CMP016

    Does anyone know what is going on that produces the totally inconsistent and odd mixed behavior?

    ------------------------------
    Michael Lusicic
    ------------------------------


  • 2.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Thu August 12, 2021 03:14 PM

    Why not skip the pre-allocation and use SITE to set the characteristics. I *know* that works from lots of personal experience. If you client does not recognize SITE then use QUOTE SITE ...

     

    Charles

     






  • 3.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Tue August 17, 2021 11:38 AM
    I ran into the QUOTE SITE and SITE command issue before. Thanks.

    ------------------------------
    Michael Lusicic
    ------------------------------



  • 4.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Thu August 12, 2021 03:14 PM
    DId you try adding DSORG=PS to the JCL? 
    Brian Kennelly
    Technical Product Manager
    www.SMAtechnologies.com
    15333 JFK Boulevard, Suite 300
     | HoustonTX 77032
    Office: 281.312.6604 | Toll Free: 877.762.6584
    www.SMAtechnologies.com
    | bkennelly@smatechnologies.com
    Facebook
    Twitter
    LinkedIn
    YouTube
     
    The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited.


    Signature For Brian Kennelly





  • 5.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Tue August 17, 2021 11:55 AM
    This is what I needed. Never ran into the need to do this before, so I didn't realized it was available.

    ------------------------------
    Michael Lusicic
    ------------------------------



  • 6.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Fri August 13, 2021 04:59 AM
    Don't mix up record format (RECFM) with data set organisation (DSORG). RECFM can be fixed (F, FB, FBM, FBA), or variable (V, VB, VBM, VBA), or undefined (U). DSORG can be physical sequential (PS), or partitioned organized (PO / POE), and some more which are not of interest for your transfer.

    Instead of preallocating before the FTP, tell FTP server on z/OS how to allocate. On the PC, type the folowing command before sending the file:

       site recfm=fb lrecl=80 

    if you also need to specify space information add the following parameters to the site command:

      cyl pri=nnn sec=nnn

    where nnn are the number of cylinders you ask for (1 cylinder is roughly 700KB).

    On Windows FTP client you need to prefix above command with "quote". Other FTP clients may, or may not need the "quote".

    If you transfer in ASCII (text) mode, and if you need to specify the code pages to use, send the following command:

      site sbdataconn=(zos-side-code-page,pc-side-code-page)

    For example

      site sbdataconn=(IBM-1148,ISO8859-1)

    There are more helpful options. Have a look at the "z/OS Communication Server IP User's Guide".










  • 7.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Fri August 13, 2021 09:25 AM

    @Peter's reply is exactly correct. As I said in my post, I know from extensive personal experience that this approach will work exactly as advertised.

     

    Prefixing SITE with QUOTE *never* hurts anything, and *may* be necessary in some cases.

     

    If you do not specify the space (cyl pri= etc.) then FTP will use some installation-specified default. If you run out of space then you will need to specify as @Peter indicates.

     

    Charles

     






  • 8.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Tue August 17, 2021 11:56 AM
    I did mix them up. Old age setting in.

    ------------------------------
    Michael Lusicic
    ------------------------------



  • 9.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Tue August 17, 2021 12:02 PM
    I went with putting DSORG in the JCL. The FTP commands are not what I needed. The program will ship to clients, and they will point me to the JCL I need to run, so I needed for everything to be done in that JCL.

    Thanks for you and the fellow who also pointed this out who has a name that is incomprehensible to me.

    ------------------------------
    Michael Lusicic
    ------------------------------



  • 10.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Fri August 13, 2021 02:56 PM
    Hi.
    It depends on the FTP settings on the z side.
    How about the following FTP command example?
    ・・・・・
    ftp> bin
    200 REPRESENTATION TYPE IS IMAGE
    ftp> QUOTE SITE CYL PRI=18 SEC=1 REC=FB LR=4024 BLK=16096 VOL=CMP016 U=SYSDA
    200 SITE COMMAND WAS ACCEPTED
    ftp> put .....

    ------------------------------
    晴信 吉田
    ------------------------------



  • 11.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Fri August 13, 2021 03:29 PM
    Letting the system determine the best block size is most often the
    better choice, so leave away the "BLK=" operand.
    Also, on a reasonably well setup system, you would not choose the volume
    and unit type. You most probably do not know which volume to choose,
    anyway. The system will do this for you. So, leave away the "VOL=", and
    "U=" operands.




  • 12.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Mon August 16, 2021 08:56 AM

    Michael,

     

    When you allocate (create) a data set in JCL using IEFBR14 the file is not opened and closed, so there is no end-of-file marker (unless the data set is SMS managed, I think). On TSO (ISPF) the file will be opened and closed, so the EOF marker will be written and the DSORG will be filled in in the DSCB.

     

    If you wish to create the file in JCL use a program such as IEBGENER to open and close the file so that it has the requisite DSORG. Your JCL extract below does not show what program you executed, but I will assume it is IEFBR14 (which does nothing to the file).

     

    Lennie

     






  • 13.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Tue August 17, 2021 11:57 AM
    That works

    ------------------------------
    Michael Lusicic
    ------------------------------



  • 14.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Wed August 18, 2021 03:40 AM
    You also have to be careful when using the RELEASE option in the allocation. If the dataset is closed after allocation, but has no data in it, the RELEASE will ensure to free up all unused tracks. It may automatically modify your primary and secondary cylinder attribution settings as well. So it could be that you end up in pre-allocation a very small dataset, which cannot be further extended to receive your complete PC file.

    ------------------------------
    Thomas Luther
    ------------------------------



  • 15.  RE: FTP throws Invalid DSORG when doing a PUT

    Posted Wed August 18, 2021 03:32 PM
    Good hint regarding RELEASE. 

    However, the system does *not* modify the primary nor the secondary allocation value specified when the data set was initially allocated. 

    As a matter of fact, the system (i.e. the DSCBs in the VTOC) does not even remember the *primary* value once the allocation is done. There is no such field in the DSCB. What it remembers, however, is the *secondary* space specification, and this value is used again, and again when more space needs to be allocated as the data set is being written to (until the data set run out of available extents).

    Also, be aware the SMS may release unused space in the space management cycle (depending on SMS setup) even when RELEASE was *not* specified at allocation time.

    So, instead of allocating the expected space in the *primary* allocation, make the primary very small, and allocate the expected amount as *secondary*. That makes your allocation "release safe". You will waste one extent slot in the DSCBs, but SMS managed, sequential data sets can grow into as many as 123 extents.