Parameterizing file name in Unstructured Data

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Roopanwita
Participant
Posts: 125
Joined: Mon Sep 11, 2006 4:22 am
Location: India

Parameterizing file name in Unstructured Data

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post 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.
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post 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.
Post Reply