AFAIK, there's no module available for that, I played around and got that sub, which does the main thing for me:
sub condirect { my $file = shift; my $hostfilename = shift; my $snode = shift; my $condition = shift; my $nocondition = $condition."E"; #--------------------------------------------------------------------- +--- # Environment fuer ConnectDirect setzen #------------------------------------------------------------- +----------- $ENV{NDMLOGDIR}='PATH TO WHERE YOUR C:D IS'; $ENV{NDMPROCDIR}='PATH TO /cdunix/ndm/process'; $ENV{NDMBINDIR}='PATH TO /cdunix/ndm/bin'; $ENV{NDMAPICFG}='PATH TO /cdunix/ndm/cfg/cliapi/ndmapi.cfg'; my $WDATE=`date +%d%m`; my $jobname='Testjob'; return system("/path/to/your/cdunix/ndm/bin/ndmcli -x << EOJ submit $jobname process snode=$snode st01 copy from ( pnode dsn=$file sysopts=\":DATATYPE=BINARY:XLATE=NO:STRIP.BLANKS=NO +:\" ) ckpt=0K compress extended to ( snode dsn=$hostfilename DISP=(RPL,CATLG,DELETE) DCB=(DSORG=PS,LRECL=100,RECFM=VB) ) ifst01 if (st01 le 4) then st01ok run task snode (pgm=CTMCND) sysopts=\"'ADD COND $condition $WDATE'\" run job pnode sysopts= +\"/usr/bin/kill -USR1 $$ \" else st01err run task snode (pgm=CTMCND) sysopts=\"'ADD COND $nocondition $WDATE'\" run job pnode sysopts= +\"/usr/bin/kill -USR2 $$ \" eif pend; EOJ"); }
As you can see, the sub sends a kill-signal to itselfe, USR1 or USR2.
Then you can do something, if connectdirect fails or just ends OK.
This is working for about 2 years now, with no problems.

Hope this helps.

-----------------------------------
--the good, the bad and the physi--
-----------------------------------

In reply to Re: Connect:Direct? by physi
in thread Connect:Direct? by mce

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.