0

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.

mike
  • 1,233
  • 1
  • 15
  • 36
  • Have you tried setting the record length (LRECL) to 1000 and the block size to 1004? – SaggingRufus Jan 10 '17 at 11:06
  • Also, in the sample provided, you have the LRECL as 726. – SaggingRufus Jan 10 '17 at 11:11
  • 2
    Did you think to talk to the technical staff on the Mainframe? What exactly do you mean by "unix mainframe"? USS? z/Linux? LinuxONE? z/OS knows about records and blocks, Unix-and-the-Linuxes don't. – Bill Woodger Jan 10 '17 at 12:38
  • @SaggingRufus yes, I used max record length as 1000 also.If I have all the records as 1000, it is coming correctly in each line, But if the record length is less than 1000, it fills the remaining space with the next line. I use the 'V viewer' to see the records on my side. I can see the records correctly by selecting RECFM as VB in the viewer's option. But the client side is always getting it as a FB record of 1000 RECL. – Arunachalam Arumugam Jan 12 '17 at 06:31
  • @BillWoodger It's IBM z/OS mainframe. But still they are receiving the records as FB only. But file is in VB format, I've verified it. It has Block Descriptor Word at the start, I can see the records in VB format if I see them in V viewer by selecting the RECFM as VB and format as EBCDIC. It's something to do with the NDM script to send it as a VB file. – Arunachalam Arumugam Jan 12 '17 at 06:36

3 Answers3

1

Have you tried the following:

setop01 copy from (
                        SYSOPTS=":DATATYPE=VB:"
                        file=$NDM_FILE
                        pnode
                  )
paulywill
  • 629
  • 10
  • 29
  • Yes, I've seen that DATATYPE=VB option. I tried it with, "DATATYPE=VB" and "RECFM=VBM" as specified in the IBM site. But it throws return code 8, stating that data type is not VB in NDM log. – Arunachalam Arumugam Jan 16 '17 at 06:24
0

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%
paulywill
  • 629
  • 10
  • 29
  • No, I can't use the FB. My previous implementation was Fixed length records which will fill up reminder of spaces with space. But the client expectation, is that it needs to be VB. – Arunachalam Arumugam Jan 14 '17 at 06:39
  • I heard that VB can be sent over NDM, using data_type=VB. But when I try to send using data type as VB, It throws error like data type is not VB in NDM log. – Arunachalam Arumugam Jan 14 '17 at 06:41
  • According to wiki https://en.wikipedia.org/wiki/Data_set_(IBM_mainframe): "The BLKSIZE parameter specifies the maximum length of the block. RECFM=FBS could be also specified, meaning fixed-blocked standard, meaning all the blocks except the last one were required to be in full BLKSIZE length. RECFM=VBS, or variable-blocked spanned, means a logical record could be spanned across two or more blocks, with flags in the RDW indicating whether a record segment is continued into the next block and/or was continued from the previous one." – paulywill Jan 14 '17 at 14:56
0

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.