Use AFT Filewatch for *.* need filename variable set at Xfer

All questions about Control-M jobs definitions
Post Reply
User avatar
ThePirate
Nouveau
Nouveau
Posts: 61
Joined: 04 Feb 2008 12:00
Location: Cleveland, OH

Use AFT Filewatch for *.* need filename variable set at Xfer

Post by ThePirate » 16 Sep 2009 4:42

Using CM for AFT with file watch for *.* on 6.3.01, is there a variavble that is set durring the transfer that I can use for the filename found? I want to use the Steps Tab.

On COMPSTAT=0
Set Variable NAME = \%%JOBFILENAME VALUE = %%FILENAME

where %%FILENAME is the unknown variable. Then I can use this global variable in other jobs.

I have reviewed the ctmfw solutions but I feel that this can be done without using a script. It seems to me that the AFT would place the filename into a variable since it needs to use this for the rename, overwrite, and delete.

User avatar
gglau
Nouveau
Nouveau
Posts: 317
Joined: 13 Jun 2007 12:00

Post by gglau » 16 Sep 2009 6:00

AFT enhancement in FP1 allows file watch before transfer. And with file watch, name of the watched file can be assigned to a global variable. Try this out.

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

Post by ThePirate » 16 Sep 2009 6:31

I need the name of the variable that is set at time of transfer. The sysout indicates this is a variable. Example below.

File for watch is '*.*' in directory '\Clients\TERI\RECEIVE\Load'.
Minimum file size is [0]Bytes;
Time to wait is [0]Minutes;
Start to watch for file: AIM20090914132928_6516.CRCL
File watching for file 'AIM20090914132928_6516.CRCL' completed successfully. Minimum file size is [0]Bytes.


AIM20090914132928_6516.CRCL has to be a variable.

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 16 Sep 2009 6:37

Hi,

use the variable "$$AFTFILE$$"
this is the original name of the single file you transfer with "*" wildcard
Best regards
Walty

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

Post by ThePirate » 16 Sep 2009 7:26

From the log:

TR5707 DO SETVAR '%%TERIFILENAME'= '$$AFTFILE$$' performed

On Set Variable I had the VALUE = $$AFTFILE$$

Looks like it didn't take it as a varable but as characters.

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 17 Sep 2009 1:34

Hi,

I think that the $$AFTFILE$$ can only be use on the File_Trans panel (ie: rename Output file)
Another suggestion by combining the use of <ctmfw> to detect the file and assigns it the global variable.

1) Create one sample rule like:

INTERVAL 10
ON_FILEWATCH /tmp/AGEN* CREATE
THEN
DO_CMD ctmvar -action set -var "%%\MY_FILENAME" -varexpr %FILENAME%
END_ON


2) On your AFT job in Set Tab put:

%%PRECMD ctmfw -input <full path name of rule file>
Set the file name detected to Global Variable before execution of the file-transfert
or
%%POSTCMD ctmfw -input <full path name of rule file>
Set the file name detected to Global Variable after execution of the file-transfert

Try
Best regards
Walty

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

Post by ThePirate » 17 Sep 2009 8:24

Thank you for your input. I have successfully performed it using the POSTCMD.

However, how about this? I posted the question to Development in Israel through a contact and his reply is below. Too simple!!! For the solution below you must have imported the latest AFT Application Form. Select the advanced button next to the file transfer definition, and go to the File Watcher tab.

From Development:
Regarding the auto edit, what about the “Auto-Edit containing detected file name:%%” field in the file watch tab?

In page 56 in the Admin guide: “5 Specify the Auto-Edit variable name that contains the detected file name.”

After the transfer this autoedit will be a global autoedit containing the name of the detected file.

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 17 Sep 2009 8:53

Hi,

Good discussion !
Thank you for your answer.
Best regards
Walty

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

Post by ThePirate » 17 Sep 2009 9:01

gglau wrote:AFT enhancement in FP1 allows file watch before transfer. And with file watch, name of the watched file can be assigned to a global variable. Try this out.
After rereading your solution I noticed that you said the same thing as development below. Thank you for your input. So sorry I misunderstood it.

User avatar
Rashid
Nouveau
Nouveau
Posts: 56
Joined: 31 Oct 2009 12:00

hi

Post by Rashid » 16 Oct 2011 2:08

Noted, Good thread

User avatar
Smithlife
Nouveau
Nouveau
Posts: 2
Joined: 15 May 2013 12:00

Post by Smithlife » 15 May 2013 9:49

Wirklich good.i werde darüber betreffen.




__________________________________________________
Diablo 3 Gold;WOW Gold;Diablo 3 Gold Kaufen;Guild Wars 2 Gold

Post Reply