Knowledge base

Connect:Direct

Connect:Direct is a product of Sterling Commerce. More info of the product can be found on www.sterlingcommerce.com.

PRODBX supports calls to Connect:Direct to send files, generated by the fixed file client, to another computer. Since PRODBX runs on Microsoft based computers, using Connect:Direct may be a way to support other operating systems, when the data exchange can happen through file transfer.

You do not have to install the System Development Kit of Connect:Direct to enable this function.

If you want to use Connect:Direct support you must specify the /CD option in the shortcut calling the PRODBX Client. (See Installation - Client Shortcut)

Once enabled, the client will get an extra menu option where you can specify some additional parameters.

 

 
 

  • S-node name: The Connect:Direct Server node name. Make sure this machine has a running server of Connect:Direct and this name is known in the client connection list of Connect:Direct.
  • Username: The username to login on the S-node.
  • Password: The password corresponding the username to login on the S-node.
  • Command file: The Connect:Direct file holding the script to transfer the by PRODBX generated files. See later for more explanation on this subject.
  • Send on create: when enabled the files are directly send when PRODBX finishes the creation of a file. As soon a file is closed by PRODBX it does a Connect:Direct call to the command file specified. This call gets an extra parameter &filename which holds the filename, without the path, of the file to be send.
  • Scan directory: when enabled PRODBX will scan the output directory following the rules as specified in the configuration manager. (See Configuration manager - Fixed file). The directory scanned is the directory specified at the outgoing files section. The rule is the same as the one specified in the incoming files section when 'Scan directory' is enabled.

Pay special attention to the command file, which is holding the script for Connect:Direct. More information can be found in the documentation of CD. Also the contents of the script is case sensitive. PRODBX passes only one parameter which is &filename. Make sure you use this parameter in your script, written in the exact same way as specified here. For instance &Filename won't work because of the capital F.

Example of a minimum script transferring the file generated by PRODBX from one machine to another:

/*BEGIN_REQUESTER_COMMENTS
$PNODE$="PROMESCLIENT1" $PNODE_OS$="Windows NT"
$SNODE$="PROMESCLIENT2" $SNODE_OS$="Windows NT"
$OPTIONS$="WDOS"
END_REQUESTER_COMMENTS*/

UOAD PROCESS
    &filename=""
    &receivedir="C:\"
    &senddir="D:\"
    &receivefile="&receivedir.&filename"
    &sendfile="&senddir.&filename"
    SNODE=PROMESSERVER

STEP1 COPY
    FROM (
        FILE="&sendfile"
    )
    TO (
        FILE="&receivefile"
        DISP=RPL
    )

PEND

In this example the &filename is transferred from PROMESCLIENT1\\D:\ to PROMESCLIENT2\\C:\. Make sure the &senddir holds the same path as specified for the PRODBX client in the outgoing files section of the configuration manager.

A little bit more robust would be a script like this:

/*BEGIN_REQUESTER_COMMENTS
$PNODE$="PROMESCLIENT1" $PNODE_OS$="Windows NT"
$SNODE$="PROMESCLIENT2" $SNODE_OS$="Windows NT"
$OPTIONS$="WDNO,WDOS"
END_REQUESTER_COMMENTS*/

UOAD PROCESS
    &filename=""
    &receivedir="C:\"
    &senddir="D:\"
    &receivefile="&receivedir.&filename"
    &sendfile="&senddir.&filename"
    SNODE="PROMESSERVER"

STEP1 COPY
    FROM (
        FILE="&sendfile"
    )
    TO (
        FILE="&receivefile"
        DISP=RPL
    )

IF (STEP1 NE 0) THEN

STEP2 RUN JOB (DSN=WindowsNT/95)
    SYSOPTS="CMD(MOVE &sendfile D:\&filename)"

ELSE

STEP3 RUN JOB
    SYSOPTS="CMD(MOVE &sendfile D:\archive\&filename)"

EIF

PEND

Together with this script you enable 'Send on Create' and 'Scan directory'. You also specify the 'Reset archive' option in the configuration manager.

The logic is: when PRODBX generates an output file, it calls the Connect:Direct script. When the file transfer is successful, the file is copied into a archive folder. However, when the transfer did not succeed the file will be copied in the same directory as the output directory. In this case the archive attribute of the file is set again. Every 10 seconds, PRODBX will scan the output directory and try to post the files that have the archive attribute set (which is indeed the same file that previously was not sent). If the output directory holds more then one unsent file, it will send them in FIFO order.

One last remark: make sure all Connect:Direct nodes are known in the netmap section of your S-node.