We help IT Professionals succeed at work.

How to pull in binnary from a mainframe using Direct Connect

HIONSPD
HIONSPD asked
on
4,767 Views
Last Modified: 2013-12-21
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

Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
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

Author

Commented:
Sorry for the delay, I'll test this option and I'll let you know..
Thanks

Author

Commented:
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...?
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
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

Author

Commented:
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
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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.    

.....???

Author

Commented:
hint for you...

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

Author

Commented:
but im not sure what does that mean yet...
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
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?

Author

Commented:
Thank You

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.