Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put Command with File Adapter in Rule Is Outputing Multiple Files

Status
Not open for further replies.

MPTC

MIS
Dec 12, 2003
22
0
0
US
Hello,

I am using the Put command with the File adapter in a map rule to output a file with a variable name. However, I am getting two files created instead of the desired one file when I use the following rule:

PUT("File", "C:\Documents and Settings\Desktop\" + TEXT(BatchNumber Field:.:UnidataInput) + "(" + FROMDATETIME(CURRENTDATE(), "YYMMDD") + ")" + ".NCP", PACKAGE(NcpdpBatch))

If I change the map rule to the following I only get one file:

PUT("File", "C:\Documents and Settings\Desktop\" + "(" + FROMDATETIME(CURRENTDATE(), "YYMMDD") + ")" + ".NCP", PACKAGE(NcpdpBatch))

Does anyone know why, in this case, using a data element from the input as part of the name of the output causes two files to be created? I have created file names for output using data elements before to create unique file names for the output and I have not run into this.

Thanks for any help.
 
Is batch number part of a series? In that case you will get a file for each batch number. Try specifying a specific index, e.g. TEXT(BatchNumber Field:Line[1]:UnidataInput) to just get one file.
 
pgrivell,

Each input file only has 1 batch number. It could potentially be a series but it is not so far. The two outputs I am getting are: 1) has the full name I am trying to create i.e. 123456(040205).NCP. 2) only has the date portion and the extension but the batch number is not included i.e. (040205).NCP.

I did try your suggestion of specifying an index [1] but I got the same result.

Thanks for your help.

Clint
 
The only thing I can suggest without seeing your map is to take out the PUT command for now and create a rule to generate the file name only and see how many file names you get. Or upload your map to
 
Other test would be to use a RUN map and set it's audit log to append to see how many times it gets called.

BocaBurger
<===========================||////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Thanks pgrivell and BocaBurger for the suggestions. I will work on both of them and see what I get.

Clint
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top