PROBLEM with AFT which transfer multiple files from multiple

A lot of scripts ans example to extract information from Control-M tools.
Post Reply
User avatar
shiva2010
Nouveau
Nouveau
Posts: 30
Joined: 15 Jun 2010 12:00
Contact:

PROBLEM with AFT which transfer multiple files from multiple

Post by shiva2010 » 19 Nov 2010 8:43

Hi All,
we have below criteria we have serveral streams from streamserve we need to transfer the file in below manner :-

1] Need to be create a file watcher which will find that CSV file has been generated in source location once the file has been traced by file watcher transfer needs to be start in following manner :
1] Category 1 needs to be transfered after that
2] Category 2 needs to be transfered after finishes this
3] catergory 3 which is CSV file needs to be transfer.
here I can put conditions like if file watcher founds CSV file than it should trigger other jobs as category 1 & after that @ and finally CSV file itself.

BUT the major problem is there are multiple streams and will not be aware about there sequence number and not sure that which stream will generate the CSV at what time otherwise I would have create only one jobs by putting ORG_VIC_*.CSV in this case what to do cause the different streams are not dependent on each other so I can't use the * option to transfer in whole bulk format in this case shall we create a script in unix itself and trigger with the help of control-m..


Kindly give your valueble suggestion will help us to build the deveolpment enviorment iteself. Below I have mentioned the file format so you will get some hint.

===============================================
Stream 1:
Category 1:
ORG_VIC_800020_BW_<Date>_<Time>.zip
ORG_VIC_800021_BW_<Date>_<Time>.zip
Category 2:
ORG_VIC_800020_RPTS_<Date>_<Time>.ZIP
Category 3:
ORG_VIC_800020_CTRL_<Date>_<Time>.CSV
----------------------------------
Stream 2:
Category 1:
ORG_VIC_800030_BW_<Date>_<Time>.zip
ORG_VIC_800031_BW_<Date>_<Time>.zip
ORG_VIC_800032_BW_<Date>_<Time>.zip
Category 2:
ORG_VIC_800030_RPTS_<Date>_<Time>.ZIP
Category 3:
ORG_VIC_800030_CTRL_<Date>_<Time>.CSV

Thanks & Regards,

shiva

User avatar
ThePirate
Nouveau
Nouveau
Posts: 61
Joined: 04 Feb 2008 12:00
Location: Cleveland, OH

Post by ThePirate » 28 Nov 2010 1:37

I have tried to perform with the AFT itself but was unsuccessful. I had to find a .na file and if it had a matching .dl file this was a placement file utherwise the all other .na files were maintenance files. I first downloaded all the files (you could do this when you find the .csv) and then I used a batch job to do the rest. My code is in windows since I don't know UNIX. My code is below.

setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%da in ('dir /b *.na') do (
set str=%%a
set prefix=d!str:~0.8!
echo !prefix!
move "<Local>\!prefix!.na" "<Local>\Staging\"
move "<Local>\!prefix!.dl" "<Local>\Staging\"

and then I was required to merge them. You will need to do something similar I think. Sorry I can't be of more help.

Post Reply