Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

DTR midification suggestions please

Go to solution

DTR midification suggestions please

I am using DTR for querying the records

The file that I am using is of 1536 bytes length and the copybook associated with that file is having header and detail records
(means Detail records are redefined by header records by redefines clause)
so if I am querying the first 10 records with alt-key-type = "4" and it is displaying both the header and detail records
and If I modify all the queried records with a Header field then the detail records are also getting modified.
I dont know why this is happening I can filter the detail and header records separately for querying but
My doubt is that DTR cannot handle these type of false changes
since it will effect mostly in the testing process.
Is there any other way?
and I am using cobol programs for execution
Hein van den Heuvel
Honored Contributor

Re: DTR midification suggestions please

You have to find a field (column) in there that allows you to distinguish unambiguously which record is a header, which one a detail.

For example, there might be a line number which is 0 for the header. In that case your query should be modified to include a selection clause on that column.

That may look like:

MODIFY xxx WITH alt-key-type=4 AND line-number=0 USING BEGIN ...

If there are no distinguisng columns, only the order, then you may need you nest your queries, selecting the first records first

IF alt-key-type=4 THEN MODIFY ...

FOR outer IN xxx WITH alt-key-type=4
FOR FIRST 1 inner IN xxx MODIFY ...

The presence of RMS keys, total record counts, selected record counts will determine which approach is best.

For further help you probably need to show us some critical columns (4 o 5) from some (2 or 3 ) example data records, perhaps in a .TXT attachment.
Maybe add output from SHOW xxx_REC ... or at least the first part of that showing the redefine.
Maybe add some record count indication and rms key/index pointers.

The record bytes length, the only detail you provided so far, is in fact the least interesting attribute of the file!

Hope this helps some,