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!

Calling a Map with -IE

Status
Not open for further replies.

MarkX1

Programmer
Mar 17, 2005
7
BE
Hi,

We're trying to run a 6.7.1 - map through the command server using the following syntax :

mercator myMap.sun -IE1 '<data>'

where <data> is the ouput of a Sybase-Query (DBQuery) containing 1 Row with 2 Columns with the following Typetree-definitions :
1) Field1 :
- integer; size_min=0; size_max=11; padded
2) Field2 :
- character; size_min=19; size_max=19; not padded

When this input is parsed by the map, in the Input-trace
we get a correct parsing for the 2 fields, but not for the Row :

(Level 1: Offset 30, len 0, comp 1 of 1, #1, DI 00000003:)
Data at offset 30 ('(end of data)...') does not match TERMINATOR '<CR><LF>'of TYPE X'0005' (Row MQS_GetNewRunId Database DataStructure).

My question is :
1) Is it possible to pass this DBQuery as -IE(cho) to this map ?
2) What's the syntax to pass this 'echo' (especially : the Row terminator) knowing that the typetree was generated on Windows-NT, the map compiled and distributed through the IFD on Sun Solaris...

One last 'good-to-know' : When calling myMap.sun from another map (using RUN) while overriding that same input-card we use : "-IE1 '" + TEXT(DBQuery) + "'" and this works fine...

Any hints to help us in the right direction ?

Thx & Cu-All
 
Your type tree in mymap has a <CR><LF> delimiter set for the input data but you are not passing one at the end of the row.
You could either remove the <CR><LF> from the type tree in mymap or you could do
mercator myMap.sun -IE1 '<data>' + "<CR><LF" to add the correct terminator to the data you are passing.
 
Since they are on Solaris, the delimiter should be set to <NL> (if it really occurs in the data) since <cr><lf> is not used in a UNIX environment. Might just want to put the DBQuery into the map's input card, so you con't have to over-ride anything.


JuJutsu - Jeff S.
Support Analyst
 
Since you are using DBQuery to extract data from a database, it would make more sense to use the DB Adaptor for running the map instead of extracting the data and then sending it using the "TEXT" function using the echo adaptor.
This way when the map executes, it would directly extract the data from the database.
You would have to change your type tree though.

Hope this helps

Cheers
Alpesh :)
 
Thnx 2U-All for the feedback...

to alphesh0111 : not an option, because DBquery already executed by another map and re-execution in this map is not allowed... (leads to too complex rollback scenario's...)

to janhes/JuJutsu : We've tried about every existing combination to get the <CR><LF> or the <NL> character added to the echoed data (even Hex(0a,0d), \r\n, \n), but we couldn't get it right... (our fault, I guess...)

However, when putting the data to echo in a temp-file using the following Unix-command :
echo "<data>\r" > tempfile
and using the following syntax :
mercator -IF1 'temp-file'
the overriding and parsing are ok...
(knowing that the unix-echo command adds a \n to temp-file)

This solution will do fine for us, because the standard situation in which the map wil run is through the eventserver and the above way, through the command server, is only used in fallback situations...

Again, thx to you all for the hints given !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top