connect:direct - generate a Mainframe VB file with RDW

482 views Asked by At

using FTP with the option "-RDW TRUE" generates a file, where each row begins with contains 4 bytes - The 1st two bytes contains the length of the row.

for example: 05 b8 00 00 00 0c 01 1c 00 04 90 8c 06 4c 00 00 where: 1. The 1st two bytes are the row length 2. The data starts at byte 5....

How can I generate the same using "connect:direct" ?

1

There are 1 answers

0
Ceifeiro On

When using Connect:Direct to send a file to a Mainframe, you will need to provide the Data Control Block(DCB) information. This will tell the Mainframe how it should catalog the file.

For example, if you have a file that will be 100 byte max length, then your DCB would look like the following:

DCB=(RECFM=VB,LRECL=104)

This tells the mainframe to use a record format(RECFM) of Variable Block and a record length(LRECL) of 100 + 4.

The following is an example of a file being sent from a Linux server to a Mainframe:

$CDDIR/ndm/bin/direct -x << EOJ1
submit maxdelay=unlimited

ProcName PROCESS
      SNODE=$SNODE

      COPY01 COPY
      FROM (FILE=/<YourPath>/<YourFileName>)
        TO (FILE="TARGET.NAME(+1)"
            DISP=REPL
            DCB=(RECFM=VB,LRECL=104)
            SPACE=(TRK,(1,1),RLSE)
            )

      PEND;
      QUIT;
EOJ1

I hope this helps.