How to send a binary (ebcdic format) file with variable blocks (each record has variable length), from a unix system to a unix mainframe through NDM?
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.
Have you tried the following: setop01 copy from ( SYSOPTS=":DATATYPE=VB:" file=$NDM_FILE pnode )
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%
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.
Use sed to print matching lines
Invoke a shell script execution using nagios
Oozie shell action not running as submitting user
simulating linux's “cd” command in python , and persist the directory change after the program exits [duplicate]
Make configuration file point to an existing file
How to every read three lines into html table from var?
Send command from batch shell to shell
How to get response from https url using curl and shell script
Setting Shell Positional Parameters With “set ls -AF”
Answer multiple questions from script shell
Memory Requirements of Shell Variable Assignment
Unable to create directory in jenkins using shell command
rm -rf /base-dir-path/*/work isn't the same as /base-dir-path/*/*/work
Aid with tcsh shell script for protein research
Strange behaviour of declare/typeset with “options” array in zsh
Create a directory at user's home directory throught a shell script with command mkdir ~/adirectory