Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
mwscott1
Creator
Creator

How to load files with dates in name

I have a file that is automatically generated and replaced everyday by a file with same file name except the date changes.

Example = NEW_AGENT_2016.09.22.TXT

I only need to pull current days file. Is there a way to do this without going in and updating the load statement everyday with the new file name?

LOAD [Agent Code],

     [Agent Name],

     [Curr Rep Type]

    

FROM

[\\FILE_LOCATION\NEW_AGENT_2016.09.22.TXT]

(txt, utf8, embedded labels, delimiter is ',', msq);

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

LET vDate = Date(Today(), 'YYYY.MM.DD');

LOAD [Agent Code],

    [Agent Name],

    [Curr Rep Type]

   

FROM

[\\FILE_LOCATION\NEW_AGENT_$(vDate).TXT]

(txt, utf8, embedded labels, delimiter is ',', msq);

View solution in original post

2 Replies
sunny_talwar

May be like this:

LET vDate = Date(Today(), 'YYYY.MM.DD');

LOAD [Agent Code],

    [Agent Name],

    [Curr Rep Type]

   

FROM

[\\FILE_LOCATION\NEW_AGENT_$(vDate).TXT]

(txt, utf8, embedded labels, delimiter is ',', msq);

Anonymous
Not applicable

you can define a variable

Let vtoday=date(today(),'YYYY.MM.DD');

and the use

load

..

FROM

[\\FILE_LOCATION\NEW_AGENT_$(vtoday).TXT]

(txt, utf8, embedded labels, delimiter is ',', msq);