How to receive a file for which the exact name is not known.
search cancel

How to receive a file for which the exact name is not known.


Article ID: 235301


Updated On:


XCOM Data Transport


Suppose that it is needed to retrieve via XCOM a file from a remote server that has a date & timestamp at the end of the filename. The exact timestamp (and therefore the exact filename) is not known.

One possibility would be to use wildcards for the remote filename in the transfer request. However, this approach is not guaranteed to work in all cases. For example, it could retrieve additional unwanted files from the remote server.

Is there another way to achieve this goal?


Release : 12.0

Component : XCOM Data Transport for z/OS


The SENDJOB functionality of XCOM may help in this situation. It sends a script to the remote system (a JCL in case of MVS) which the remote XCOM executes in the remote system (in case of MVS, XCOM submits the job to the MVS internal reader)

SENDJOB can be used to send a script (or JCL) that locates the exact file to be transferred and sends it back to the originating XCOM.

For example, if the target XCOM is a Linux, the script sent could be as simple as:

for file in /folder/prefix*
  xcomtcp -c1 -f transfer_parameters.cnf LOCAL_FILE=$file