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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing some Basic Concepts 1

Status
Not open for further replies.

qlark

Programmer
Jan 5, 2006
54
CA
Is there anywhere to find basic concepts of using Merc 6.7 ... ie a FAQ for dummies?

I have been maintaining 3 maps for over 6 years and now need to expand one of these maps.

This map has a type tree that has two sets of data;

group(s)
partner(s)

So each group can have partners and the input file can have many partners.

My task is to split out the partners and regroup them into distinct output files.

The concept I am having a problem with; I am thinking that the output file should be able to export the contents of a partner with out specifying the Partner details? I was thinking this would be done in two steps first gather all the Partner(s) then split the Partners in to new groups all sharing the same Type Tree

IE taking the Type Tree that defines this input and use it for both the input and output cards

SplitPartners
Input In1
tree xyz
type group(s)

Output Out1
tree xyz
type Partners(s) Rule =MakePartners(In1)

MakeNewGroups
Input In2
Tree xyz
Type Partner(S)

Output Out2
tree xyz
type Group Rule =MakeGroup(In2) where Partner = "ABC"

Output Out3
Tree xyz
type Group Rule =MakeGroup(In2) Where Partner <> "ABC"

 
You can do the tutorial and read the documentation supplied with DSTX 6.7
 
I have been looking at the examples CH1-20 and reading the help file but I find the HOW-TO descriptions missing the WHY.

I was able to finally get to step one which gathers all the Partners ... this confirmed my question in that Mercator can output objects without having to map every detail ... there is one minor issue with the new output file; the Group wrapper has GROUP<CR>GROUPNUM<LF>[PARTNERS]<LF>GROUPEND<CR>GROUPCOUNT<LF> as defined by the type tree ... when I separate the Group header footer the delimiters are still there <CR><LF>[PARTNERS]<CR><LF>

Is there some other way other then defining these fields as =NONE to eliminate the delimiters? Do I possibly need to make another File entry in the Type Tree that just defines the Partners by themselves?

 
Strongly suggest you to learn mercator before you start.

It's worse than a sword, which will cut your finger if you don't know how to use it. (nuclear bomb?)

Know the concepts well (even including partition, decouple, etc.), then work on Mercator.

if you are luck, you can do most of your initial need by designing types right.
 
By adding an EXTRACT function I have been able to use the existing map to separate out the partners. I have gone through the documentation and tutorials and left wondering if there is some way to define the output file as a variable determined by input data? Right now I can create two maps which have distinct output file names but then I need to write a script to run them ... it would be nice to pass in a variable that tells one map what to extract and what file to run ... I can then easily create another input card that has the name of the data to extract but would it be possible to also include the name of the output file there as well?
 
You can use PUT or pass the file name to another map.
 
Read docs about RUN maps.

BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
You can use control maps to override output file names of it's run-maps. You can also use a rule like ... 'put("file", file_path\name, data) to create files with variable names but it can be a very inefficient use of machine resources and cause map failures accordingly.

or

We are moving away from the event server and starting to use a non-tx scheduler.... one that is common for all environments/tools/aplications.... Essentially, in some cases now, the scheduler executes a runmap passing it variables related to the data it needs to process....

-output_path\file_name
-processing_id (used to log transaction)
-input_path\file_name(used to over-ride the runmap input file)
-runmap_configuration_id (control map queries a DB to determine what other maps need to run based on ID)
-other optional info depending on needs

The cntl map also overrides the run-map log and trace file sttings as needed. All log files are created on error using the processing_id.

 
We are running mercnt 6.7
I run maps using old dos batch command files using the following command

c:\mercator\mercnt <mappath>\<mapname>

I have looked through the documentation and don't see a switch and or example that would allow me to add an override value to the command line that would modify the INPUT/OUTPUT card source files are you saying that if I add -input_path\file_name or -output_path\file_name to the command line this will override the files?


 
example of executing cntl map via command server:

path\mercator6.7\mercnt path\map.mmc -ie1 'input_field1~input_field2~input_field3~~~input_field?' -ae=log_file_name.xml -b

Assume:
- input_field1 is path for file needing processing
- input_field2 is processing_id
- input_field3 is mapping id (cntl map looks up runmap path\name from DB with this id)

Cntl runmap rule sample puntuation would need work...

run("'"+dblookup(select runmap from table where map_name = '" + input_field3 + "'", "-mdq mdqfile.mdq db dataname")+"'",
/* Override runmap log file name and settings */
" -aew='" + input_field2 +".xml'" +
/* Control I/O */
" -IF1 '" + input_field1 + "'" +
ECHOIN (2, PACKAGE (other_data)) +
" -OF2 '" + output_file_name + "'")

Keep in mind you have a DOS limit on the size of your command line.

 
PS: We use one control map for specific types of data like bank files, eligibility, reporting etc.. The control is used when we may get multiple data formats for a single data type.... the map id is tied to data format. New files are assinged one of many map-ids by our business groups via a web interface.

If you only have one data format you prob don't want to use the control map...... so just use the -IFn '....' -OFn '....' to override input output file names via the batch command file.

see the pdf 'Execution Command Reference Guide'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top