This is my NDM script:


#!/bin/bash -x
#/cdunix/ndm/bin/ndmcli -x -e 4 << _EOF_
#sub maxdelay=unlimited statemnt process snode=$DEST_NODE
export NDMAPICFG=/home/drone/ndmscripts/ndmapi.cfg
NDM_FILE=$1
DEST_FILE=`basename $1`
DEST_NODE=AAA
/cdunix/ndm/bin/ndmcli -x -e 4 << _EOF_
sub maxdelay=unlimited testcopy process snode=$DEST_NODE snodeid=(BBB,123)
setop01 copy from (
                        SYSOPTS=":DATATYPE=BINARY:XLATE=NO:STRIP.BLANKS=NO:"
                        file=$NDM_FILE
                        pnode
                )
             COMPRESS EXTENDED
             to   (
                        DSN=$DEST_FILE(+1)
                        UNIT=(BATCH,2)
                        SPACE=(CYL,(500,500),RLSE)
                        DCB=(RECFM=VB,LRECL=726,BLKSIZE=0)
                        snode
                )
        pend;
_EOF_

I've given the LRECL as 1004 here because, the maximum record length is 1000. I've specified the RECFM as VB to denote that is a variable block record. But still on the unix mainframe, they receive the file as fixed length of 1000. My first 3 records are of length 132, 32, 1000. It fills the first line with first 2 records (164) and third record's 836 position's into first line and put the reminder of third record into second line and so on. So, I'm getting a position mismatch on unix mainframe. I can only alter on unix side. But can do nothing on client's unix mainframe side. How can I change my script to send the file as variable length records?

P.S : I've read through all the threads related to this topic. I've tried almost 100's of changes in the past 3 months. Nothing really works for me.

3

There are 3 answers

0
Arunachalam Arumugam On BEST ANSWER

Strange.. I've tried a lot with SYSOPTS=":DATATYPE=VB:", But nothing Worked. Then I tried RECFM as VB instead of VBM (as specified by IBM) and LRECL as 1004 (my report's default value) instead of 726 (actual maximum record length) and it worked.

Here is my NDM script:

#!/bin/bash -x
#/cdunix/ndm/bin/ndmcli -x -e 4 << _EOF_
#sub maxdelay=unlimited statemnt process snode=$DEST_NODE
export NDMAPICFG=/home/drone/ndmscripts/ndmapi.cfg
NDM_FILE=$1
DEST_FILE=`basename $1`
DEST_NODE=XXX
/cdunix/ndm/bin/ndmcli -x -e 4 << _EOF_
sub maxdelay=unlimited testcopy process snode=$DEST_NODE snodeid=(AAA,123)
setop01 copy from (
                        SYSOPTS=":DATATYPE=VB:XLATE=NO:STRIP.BLANKS=NO:"
                        file=$NDM_FILE
                        pnode
                )
                COMPRESS EXTENDED
             to   (
                        DSN=$DEST_FILE(+1)
                        UNIT=(BATCH,2)
                        SPACE=(CYL,(500,500),RLSE)
                        DCB=(RECFM=VB,LRECL=1004,BLKSIZE=0)
                        snode
                )
        pend;
_EOF_

It is strange because, previously It thrown error like "data type is not VB". But now it accepted the datatype=VB after changing the RECFM and LREL.

3
paulywill On

You have to use FB and set a blocksize.

Your VB record format is actually working correctly and that's why it's filling up the different lines.

As @BillWoodger alluding to earlier you're sending it to z/OS dataset structure when you indicate block, recfm, cyclinders not the z/OS Unix file structure that's running on the mainframe (USS - Unix System Services) such as HFS or zFS.

We experience this is our shop when upload BIN fixes and PTFS to the z/OS dataset file structures. If we take the default it becomes a mess that's unreadable.

We have to FTP using something such as the following:

set pri=20
set sec=20
set proddataset=IPP.PROD
set dsntype=cylinders
set recfm=fb
set lrecl=27998
set blksize=27998
set volume=PPINS2

echo quote site pri=%pri% sec=%sec% %dsntype% recfm=%recfm% lrecl=%lrecl% blksize=%blksize% volume=%volume%
1
paulywill On

Have you tried the following:

setop01 copy from (
                        SYSOPTS=":DATATYPE=VB:"
                        file=$NDM_FILE
                        pnode
                  )