Operating System - OpenVMS
1751976 Members
4620 Online
108784 Solutions
New Discussion

DTR midification suggestions please

 
SOLVED
Go to solution
RAVI KISHORE_1
Advisor

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
1 REPLY 1
Hein van den Heuvel
Honored Contributor
Solution

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

FOR FIRST 1 xxx WITH ..
IF alt-key-type=4 THEN MODIFY ...

or
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,

Hein.