IBM Support

How to pull files from Sterling Connect:Direct for Windows to UNIX® using wildcards.

Question & Answer


Question

How can I pull files from Sterling Connect:Direct for Windows to UNIX® then move the Windows files to an archive folder.

Answer

proc1 process snode=Windows
step1 copy from (file=c:\tempdir\*.txt snode)
                     to (file=/home/userdir/ pnode)
 if (step1 EQ 0) then
   run task snode
    sysopts="cmd(move c:\tempdir\*.txt c:\bakdir\)"
 eif
 pend;

If new files are written to the source directory after the process has started, they will be moved by the run task to the archive directory so there is the risk that they are not copied to the remote.
To avoid this you can add an additional Run Task step to move the files in the Temp directory to an upload directory first, then copy them from the upload directory and finally move them to the bakdir, that way any files put in tempdir after the process has started will not be actioned until the next invocation.

proc1 process snode=Windows
step1 run task snode
    sysopts="cmd(move c:\tempdir\*.txt c:\uploaddir\)"
if (step1 Eq 0)
step2 copy from (file=c:\uploaddir\*.txt snode)
                     to (file=/home/userdir/ pnode)
 if (step2 EQ 0) then
   run task snode
    sysopts="cmd(move c:\uploaddir\*.txt c:\bakdir\)"
 eif
eif
 pend;

[{"Product":{"code":"SSKTYY","label":"IBM Sterling Connect:Direct for UNIX"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF010","label":"HP-UX"},{"code":"PF027","label":"Solaris"},{"code":"PF002","label":"AIX"}],"Version":"4.1;4.0;3.8","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
24 July 2020

UID

swg21639141