Focal Point
[SOLVED] Iterate Over Many Libraries For Same Data Files

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/8097038986

April 03, 2018, 03:24 PM
Michael Henry
[SOLVED] Iterate Over Many Libraries For Same Data Files
Hello all, thanks for the approval to be in the forum. I'm using Data Migrator to replicate our data from an IBM iSeries over to MS SQL Server. We have many libraries, and each of them has identically structured files in them. What I want to do is use a table(s) to drive all this, or as much as I can. I've accomplished part of this but I'm having trouble taking it to the next step.

Data
For this example assume we have 500 libraries and each has 10 data files in them. A subset would be:
DTA100/ORDERHeader
DTA100/ORDERDetail
DTA500/ORDERHeader
DTA500/ORDERDetail

I currently have a table that has all the files I want, and their associated libraries. I have a view which only shows the ORDERHeader files, and another for ORDERDetail. I read this data in and put it into the "TABLENAME" field in the Synonym I've created each data file. An example would be that when the ORDERHeader view is read, it retrieves "DTA100/ORDERHeader" into a variable and puts it in "TABLENAME" in the synonym and things work. Assume I've populated the other necessary fields as those aren't the problem I need to solve.

The end result of the above is that I'll get ORDERHeader from DTA100, then DTA500, and so on, the next step would get ORDERDetail from DTA100, then DTA500, and so on.

What I WANT to do is process at ten files from DTA100, then all 10 files from DTA500, and the rest of the libraries. The problem is that the "TABLENAME" property in the synonym is full path. I dont' know how to concatenate text to populate the field.

In the "TABLENAME" property I'd like to do something like: &&LIBRARY + "/" + ORDERHeader
Where &&LIBRARY is the DTA100, DTA500, etc. Notice I'm trying to construct the full path in the property. Can I do this? Can I do it here or does it need to happen in some sort of scripting?

I know this may be confusing, but using this product depends me being able to solve this problem.

Thanks in advance.
Michael Henry

This message has been edited. Last edited by: FP Mod Chuck,


Mass Data Migrator
April 04, 2018, 01:42 PM
FP Mod Chuck
Hi Michael

First of all welcome to Focal Point. It is a great resource for getting answers to questions like yours.

It would be helpful if you could post the code you currently have so we can see the process you are using.

The answer to your question is yes you can do what you want with what is called Dialog Manager scripting code. An example would be

-SET &TABLENAME=&&LIBRARY | '/ORDERHeader';


Then use &TABLENAME for your value in the synonymn


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
April 04, 2018, 03:59 PM
Michael Henry
Thanks Chuck! What you provided is what I'm looking for except I don't see a code block for the scripting code.

Right now I don't have any code, just a flow accepting rows from a table (synonym), Then handing it off to another flow that has the source and target in it and assigns variables.

I've read a few user guides, but are there any materials to consume that would help me with the scripting like you mentioned? I'm a developer at heart and I think I would benefit greatly from learning how to flex this tool.


Mass Data Migrator
April 04, 2018, 04:04 PM
Michael Henry
quote:
Originally posted by FP Mod Chuck:
Hi Michael

First of all welcome to Focal Point. It is a great resource for getting answers to questions like yours.

It would be helpful if you could post the code you currently have so we can see the process you are using.

The answer to your question is yes you can do what you want with what is called Dialog Manager scripting code. An example would be

-SET &TABLENAME=&&LIBRARY | '/ORDERHeader';


Then use &TABLENAME for your value in the synonymn


Would this happen in the "Text View" in the flow? That's the only place I see anything which looks like scripting.


Mass Data Migrator
April 05, 2018, 10:45 AM
Clif
Please don't edit the Flow in text view; changes will be lost when you reopen.

You can assign values for variables on the Process Flow tab of the iterated Flow that uses the Synonym in a Variables object before the (purple) data flow.

Note that you must assign a GLOBAL variable (&&TABLENAME) for it be usable in the synonym.


April 05, 2018, 11:46 AM
Michael Henry
quote:
Originally posted by Clif:
Please don't edit the Flow in text view; changes will be lost when you reopen.

You can assign values for variables on the Process Flow tab of the iterated Flow that uses the Synonym in a Variables object before the (purple) data flow.

Note that you must assign a GLOBAL variable (&&TABLENAME) for it be usable in the synonym.



Thanks! In theory this solves my issue. I will go try it out.

Thanks again!


Mass Data Migrator