Link to home
Start Free TrialLog in
Avatar of HIONSPD
HIONSPD

asked on

How to pull in binnary from a mainframe using Direct Connect

Hey Guys,

A Direct Connect question:
I’m writing a script to pull a file from a mainframe in binary mode but I don’t know were within connect direct add the parameters to convert the file in to binary mode …any ideas…?
Thanks for your help..!!!  


 more MF_Pull.ksh
#!/bin/ksh
# Created by XXXXXXXX XXX  
# Purpose: Pull a file from XXXXXXXX
# This script invokes the Connectirect UNIX CLI
# and submits a process inline to copy a file to a remote
# node.

#       1. Source folder )>
#       2. Source file
#       3. Target folder $XXXX
#       4. Target file
#       5. The Target connect direct node.
#

#       Get Parameters for pull file

dol=$
ofile=$2
sodir=$1
rnode=$5
ifile=$4
tidir=$3

log=/nfsshare/autosys/qa1/out/`date "+%y%m%d%H%M"`_MF_Pull$rnode.log

sdir=`eval echo $sodir`
tdir=`eval echo $dol$tidir`

#sfile=$sdir/$ofile
sfile=$ofile
tfile=$tdir/$ifile

echo source file is $sfile > $log
echo destination file is $tfile >> $log
echo source node is $rnode >> $log

#lset -lset -vvILCODE.EXTRACT.S1S
/opt/cdunix/ndm/bin/ndmcli  -x << EOJ
submit hold=no maxdelay=0 proc1    process    snode=$rnode
       step1    copy from  (file=$sfile snode)
               ckpt = 5M compress = extended
           to   (file=$tfile pnode disp = rpl)
pend ;
EOJ

status=$?

echo Status is $status >> $log
if [ $status -ne 0 ]
then
        echo Transmission of $sfile to $tfile from $rnode FAILED >> $log
        exit $status
else
        echo $sfile pulled to $tfile from $rnode >> $log
        exit 0
fi

Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

I think it should be something like this -

/opt/cdunix/ndm/bin/ndmcli   -x << EOJ
submit hold=no maxdelay=0 proc1    process     snode=$rnode
       step1    copy from  ( file=$sfile snode
                                          sysopts=":datatype=binary:strip.blanks=no:" )
                ckpt = 5M compress = extended
           to   ( file=$tfile  pnode disp = rpl
                  sysopts=":datatype=binary:strip.blanks=no:"  )
pend ;
EOJ

wmp
Avatar of HIONSPD
HIONSPD

ASKER

Sorry for the delay, I'll test this option and I'll let you know..
Thanks
Avatar of HIONSPD

ASKER

Receiving the following error:
 $SCRIPTDIR/MF_Pull.ksh MPDP.MAILCODE.EXTRACT.S1S.G3339V00 MPDP.MAILCODE.EXTRACT.S1S.G3339V00 STGAMER MAILCODEEXTRACT.txt ndm1s

        ******************************************************
        *                                                    *
        *             Connect:Direct for UNIX                *
        *                                                    *
        *----------------------------------------------------*
        *  Copyright (c) 1992, 2006  Sterling Commerce, Inc. *
        *                   Version 3.8.00                   *
        ******************************************************

Enter a ';' at the end of a command to submit it. Type 'quit;' to exit CLI.

Direct> submit hold=no maxdelay=0 proc1    process    snode=ndm1s
        step1    copy from  (file='MPDP.MAILCODE.EXTRACT.S1S.G3339V00' snode)
                ckpt = 5M compress = extended
            to   (file=/nfsshare/Interface/Stage/americas/MAILCODEEXTRACT.txt pnode disp = rpl)
 pend ;

**** Error returned...

XPAE003I  Return Code: 8  Feedback: 0
          :&KEYWD='MPDP.MAILCODE.EXTRACT.S1S.G3339V00':

XPAM001I  Return Code: 8  Feedback: 0
          Errors Parsing

Direct>
Connect:Direct CLI Terminated...


any ideas...?
Where do the single qoutes ( ' ... ' ) around the "from" filename come from? I think they're wrong!
And where has the new "sysopts=..." statement gone?
wmp
Avatar of HIONSPD

ASKER

Here is the output again:  

 $SCRIPTDIR/MF_Pull.ksh MPDP.MAILCODE.EXTRACT.S1S.G3339V00 MPDP.MAILCODE.EXTRACT.S1S.G3339V00 STGAMER MAILCODEEXTRACT.txt ndm1s

        ******************************************************
        *                                                    *
        *             Connect:Direct for UNIX                *
        *                                                    *
        *----------------------------------------------------*
        *  Copyright (c) 1992, 2006  Sterling Commerce, Inc. *
        *                   Version 3.8.00                   *
        ******************************************************

Enter a ';' at the end of a command to submit it. Type 'quit;' to exit CLI.

Direct> submit hold=no maxdelay=0 proc1    process    snode=ndm1s
                step1    copy from  (file=MPDP.MAILCODE.EXTRACT.S1S.G3339V00 snode
                 sysopts=":datatype=binary:strip.blanks=no:")
                        ckpt = 5M compress = extended

                to   (file=/nfsshare/Interface/Stage/americas/MAILCODEEXTRACT.txt pnode disp = rpl
                 sysopts=":datatype=binary:strip.blanks=no:")
 pend ;

Process Submitted, Process Number = 3408
                   Return code    = 8
                   Message id     = XCMM041I
Direct>
Connect:Direct CLI Terminated...


Thanks
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HIONSPD

ASKER

MESSAGE ID==> XCMM041I                                            

MODULE    ==> nucmsu00                                            

==================================================================

                                                                 

SHORT TEXT==> The process is on Hold queue with HE status.        

LONG TEXT:                                                        

   LINE 1 ==> The process is on Hold queue with HE                

   LINE 2 ==> (Held due to Error) status.                        

   LINE 3 ==>                                                    

   LINE 4 ==> SYSTEM ACTION: The process completed with error.    

.....???
Avatar of HIONSPD

ASKER

hint for you...

ndmmsg -f /opt/cdunix/ndm/cfg/****SERVER_NAME****/msgfile.cfg XCMM041I
Avatar of HIONSPD

ASKER

but im not sure what does that mean yet...
Since the job was successfully submitted to the Dispatch queue to then be placed on the Hold queue I still assume that it's syntactically correct but that there's some required resource missing.
- Input file present? Access permissions correct?
- Node names OK?
- Do you have access to the job log?
Avatar of HIONSPD

ASKER

Thank You