Page 1 of 1

file not found in copy task

Posted: Thu Dec 22, 2016 9:39 am
by ehersh
I am not sure why I am getting the following error.

Project '/Production Projects/CSS/EDI/Eligibility/test_filelist_capabilities' failed. Job number is '1397289653647'.
[8009 - copy files] File '<path to>/Eligibility/test/834_CHI/archive/CCA_834_20161212_C 2.txt' not found

The file is there I am looking at it. I do jump through hoops to set up the source and destination variables. I am basically cycling through some folders looking for the archive folder in each pulling files out of that folder and placing them in a destination folder. My code is below. It is lengthy so I bolded the copy command.
Code: Select all
<project name="test_filelist_capabilities" mainModule="Main" version="2.0" logLevel="debug">
	<description>testing file list capabilities</description>

	<module name="Main">
		<!--get files-->

		<timestamp label="Date Routine" version="1.0">
			<format outputVariable="Date" pattern="yyyy-MM-dd" dayOfMonth="-${sixty_days}" />
			<format outputVariable="${system.currentDate}" />

		<createFileList fileListVariable="test_filelist" numFilesFoundVariable="filecnt" version="1.0">
			<fileset dir="<path to>/Eligibility/test/" recursive="true" />

		<!--Place files-->
		<forEachLoop itemsVariable="${test_filelist}" currentItemVariable="currentfile" currentIterationVariable="number">

			<setVariable label="Get Date" name="get_date" value="${currentfile:lastmodifieddate}" version="2.0" />

			<setVariable label="Get Year" name="get_year" value="${substring(get_date,1,4)}" version="2.0" />

			<setVariable label="get_path" name="path" value="${currentfile:path}" version="2.0" disabled="false" />

			<setVariable label="begin  position client" name="position" value="${PositionOf(path, &apos;/&apos;, 49)}" version="2.0" disabled="false" />

			<setVariable label="end position client" name="end_position" value="${PositionOf(path, &apos;/&apos;, position+1)}" version="2.0" disabled="false" />

			<setVariable label="length" name="folder_length" value="${end_position-position}" version="2.0" disabled="false" />

			<setVariable label="folder name" name="dest_folder" value="${substring(path, position,folder_length)}" version="2.0" disabled="false" />

			[b]<copy label="copy files" sourceFile="<path to>/Eligibility/test${dest_folder}/archive/20161212_C 2.txt" destDir="<path to>/Eligibility/test_files${dest_folder}/archive/${get_year}" flattenDir="true" preserveDate="true" version="1.0" disabled="false" />

	<variable name="sixty_days" value="60" description="files older than 60 days get encrypted" />

Re: file not found in copy task

Posted: Tue Dec 27, 2016 9:54 am
by Support_Rick
Keep in mind that all file attributes are Case Sensitive ... with that in mind, please look at:

<setVariable label="Get Date" name="get_date" value="${currentfile:lastmodifieddate}" version="2.0" />

and change the attribute to "lastModifiedDate", then try again.