Focal Point
[CLOSED] DataMigrator - To append current date in destination file name

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/8357064876

September 17, 2015, 04:26 PM
ANBU
[CLOSED] DataMigrator - To append current date in destination file name
Using DataMigrator - Version 7 Release 7.06.
Source is database table and destination is a flat file. For example, if the job name is 'ABC' and job run date is today (17/09/2015) then the naming convention for the destination file should be 'ABC-20150917.txt'. So how do I append the current date so that it dynamically added in destination file name.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8
Windows, All Outputs
September 18, 2015, 02:25 PM
ANBU
Can anyone help me on this topic?


WebFOCUS 8
Windows, All Outputs
September 21, 2015, 08:14 AM
dhagen
Edit the .mas file in the DMC and add a global parameter to it. Then change the DATASET reference to the variable:

 DATASET='&&OUTFILE', $ 


Use a variable object in the process flow to set the value before the data flow object:

 &&OUTFILE = 'baseapp/ABC-' || &YYMD || '.txt' 


You can change 'baseapp' to any application name.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
September 21, 2015, 11:15 AM
dhagen
Here is a the real example of a .mas:

FILENAME=SAMPLE_HALFWIDTH_CSV, SUFFIX=DFIX    ,
 DATASET=&&OUTFILE, $
 VARIABLE NAME=&&OUTFILE,  DEFAULT='files/sample_20150901.csv', $
  SEGMENT=SAMPLE_HALFWIDTH_CSV, SEGTYPE=S0, $
    FIELDNAME=FIELD_1, USAGE=I3, ACTUAL=A1, $
    FIELDNAME=FIELD_2, USAGE=I10, ACTUAL=A8, $  


The set statement:

&&OUTFILE='files/sample_' || &YYMD || '.csv'  



"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott