Yes it is possible. I would setup variables in the session rules with unique names, like DTM_090 or something along that line. When you encounter the DTM segment in the extended rule check the qualifier and set the appropriate variable, then it will always be available to map to the output data and you can map it in a loop so that the variable you need shows up for every loop until it is changed by a new DTM*qualifier. Something like this in an extended rule on the DTM segment:
IF #qualifier = "090" then DTM_090 = #qualifier; Then create a temp field on the input side in the loop and assign the temp variable to DTM_090, etc. I believe that should do the trick for you. I believe what you are seeing might be because all of the mapped variables are not in one loop? Hope this helps. Dave Records Records Consulting, LLC Phone: 616.583.0090 Email: [email protected] On Jan 11, 2011, at 1:27 PM, mrhuntman wrote: > Hello, > > Not sure if this is an OK question to ask this group but I can't find an > answer anywhere so I figured I'd try. > > I'm trying to map an 867 file to either a flat file CSV or to one table in an > MSSQL database. I'm using the Map Editor within Sterling's GIS software. > > My problem is that I need to have repeating elements in my output, and the > output elements depend on qualifiers. For instance, my input data looks like > this, with elements I don't need left out: > > BPT^20070616^SS > DTM^090^20070610 > DTM^091^20070616 > N1^DB^DISTRIBUTOR 1 > N1^MF^MANUFACTURER 1 > PTD^SS > N1^ST^SHIP TO CUSTOMER 1 > QTY^32^1^EA > DTM^003^20070613 > PTD^SS > N1^ST^SHIP TO CUSTOMER 2 > QTY^64^2^EA > DTM^003^20070613 > QTY^32^1^CT > DTM^003^20070613 > ...... > > And what I need in my output is: > > 20070616,20070610,20070616,DISTRIBUTOR 1,MANUFACTURER 1, SHIP TO CUSTOMER > 1,32,20070613 > 20070616,20070610,20070616,DISTRIBUTOR 1,MANUFACTURER 1, SHIP TO CUSTOMER > 2,64,20070613 > 20070616,20070610,20070616,DISTRIBUTOR 1,MANUFACTURER 1, SHIP TO CUSTOMER > 2,32,20070613 > > What I can't figure out is how to repeat certain elements on each line. I've > tried a bunch of different methods and can't get it to work. I get the > closest when I create a temporary structure on the input side and map that > directly to the output. I populate the temp structure by putting extended > rules on each of the elements above, but what I end up with is one instance > of each value on each line, something like this: > > 20070616,,,,,,,, > ,20070610,,,,,,, > ,,20070616,,,,,, > ,,,DISTRIBUTOR 1,,,,, > etc.. > > Is there an easy way to do this? I know having repeating elements in a > database format isn't the best, so should I be approaching this differently? > I've done this in a different mapping software pretty easily, so I know it > can be done here but I can't figure it out. > > Thanks in advance. > > [Non-text portions of this message have been removed] ------------------------------------ ... Please use the following Message Identifiers as your subject prefix: <SALES>, <JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC> Job postings are welcome, but for job postings or requests for work: <JOBS> IS REQUIRED in the subject line as a prefix.Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/EDI-L/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/EDI-L/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
