× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Fri, 2017-01-20 at 13:07 +0000, Danny Hayes wrote:
I have a program, actually 6 of them (around 5,000 lines each), that each have multiple files that have field names in common across all of the files.

The programs write a header record for incoming EDI and then write detail records for that header record.

The issue was that at the time the header record was processed and then moved on to process the details another program began processing the details before all had been written.

The decision was made to delay the writing of the header until all detail records had been processed. To do this I created a flag to say header is ready and instead of writing moved the

externally defined DS to a second one with a prefix on it so that no values would be changed prior to when I actually do write the record, after all details were processed.

Well, due to the commonly named fields the second external DS would not rename its fields because they were already defined in the first DS.

To handle this I added QUALIFIED onto each of the External DS's, this allowed everything to compile, almost.

Now the issue is the original design of the program counted on population of all fields at one time. SO even if I qualify everywhere one of the 'commonly named fields' is used I then loose the populating of

every other iteration of that field name.

My objective is to not have to write subroutines/subprocedures to manually move these hundred plus fields into a save area and then back out of the same.

I know that someone out here has had to figure this out before, although maybe not, I have never seen anything like this before, that I can recall, but then some days I don't remember what I had for lunch yesterday.


I had to do something similar... I did it by having a multiple
occurrence DS with no fields...

psudo code.

Move dataDS into DS(1)

when file flips to next set of data

Move dataDS into DS(2)
Move DS(1) into dataDS

Do heading (or flag stuff in your case) stuff using old data...

Move DS(2) into dataDS

Continue... as we are back to correct data in dataDS.

Obviously you'll need to put the moves in the right places and logic,
but its the quickest way to shift "live" file data out of the way, use
the stored (previous record) version, and then restore the "live" data
back.

It doesn't cause problems with key data, files still retain their
positions, and re-storing the data means youre back to the point as if
none of the temporary manipulation of data ever happened.



Thanks & Regards,
Danny

This e-mail and any attachments, contain Genuine Parts Company confidential information that is proprietary, privileged, and protected by applicable laws. If you have received this message in error and are not the intended recipient, you should not retain, distribute, disclose or use any of this information and you should destroy this e-mail, any attachments or copies therein forthwith. Please notify the sender immediately by e-mail if you have received this e-mail in error.

"This e-mail and any attachments, contain Genuine Parts Company confidential information that is proprietary, privileged, and protected by applicable laws. If you have received this message in error and are not the intended recipient, you should not retain, distribute, disclose or use any of this information and you should destroy this e-mail, any attachments or copies therein forthwith. Please notify the sender immediately by e-mail if you have received this e-mail in error."



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.