Page 1 of 1

Parameterizing file name in Unstructured Data

Posted: Tue Jul 23, 2013 4:33 pm
by Roopanwita
Hi,

I am using Unstructured Data Stage to read an excel file , can anybody tell how to parameterise file name . I have already tied to use Use Template file for design option to read file similar to reading using file pattern of flat file stage.

Can anyone please help me with reading file with file pattern (wild card) option. Also help to parameterise file name.

Thank you in advance.

Thanks

Posted: Tue Jul 23, 2013 4:41 pm
by ray.wurlod
Check your documentation to verify whether or not File Pattern is supported, and consider the implications if it is. Every single one of the worksheets would necessarily have to have the same organization. Do yours fit this requirement?

File Name should be able to be a job parameter (if not, "they" have missed coding it that way). But supporting wildcards is probably far too fraught with potential problems.

Posted: Mon Aug 10, 2015 12:05 pm
by rkashyap
While researching use of path from Environment variables in Unstructured Data stage, we saw this post. I am posting the observations from limited testing performed on 9.12. Do correct/add to these observations as needed.

File-name can be paramerized by enclosing the parms in hashes. i.e #FileNm# or #FilePath#/FileNm.xls or #FilePath#/#FileNm# etc.

There is a disconnect between Design time and Run time behavior, see below...
1. Parameterized file-name/file-path from Project level environment variables: Works well at run time, but at design time ... on clicking on View/Load etc, the value initially seem to resolve to the ones defined in Environment variables but subsequently errors out with "The specified file is empty. Select a different file to view."

2. Parameterized file-name/file-path defined in Job Properties: Works well at both design and run time.

3. Wild-card in file-name (on right-most position; not in file-path): Works well at run time, but design time behavior was similar to #1.

Our workaround was to design/unit-test the job with hard-coded filepath and later on swap it with Environment variable.

Posted: Wed Sep 16, 2015 6:36 pm
by rkashyap
rkashyap wrote:1. Parameterized file-name/file-path from Project level environment variables: Works well at run time, but at design time ... on clicking on View/Load etc, the value initially seem to resolve to the ones defined in Environment variables but subsequently errors out with "The specified file is empty. Select a different file to view."
APAR JR48707addresses the issue of job parameters not getting passed during design time.