Operating System - OpenVMS
1748205 Members
4666 Online
108759 Solutions
New Discussion юеВ

Re: DATATRIEVE HELP NEEDED

 
RAVI KISHORE_1
Advisor

DATATRIEVE HELP NEEDED

I am new to DTR

I am using using datatrieve to print a report

I am able to ready the file and was able to find the required records also

but while printing the records i have to edit the values of some of the fields for all the records i mean i have to do some calculations to those fields like additon and substraction and print all the changed records.



I am trying to use some declare variables but not getting it


can anyone please tell me how to get this done.


6 REPLIES 6
Hein van den Heuvel
Honored Contributor

Re: DATATRIEVE HELP NEEDED

It's not reasonable to expect us to come up with a problem and a solution and expect it to be better than just reading the manual or a googled example.

>> I am new to DTR
- studied the manuals?
- spend half a day in DTR> HELP ?
- tried DTR> SET GUIDE ?
- Studied existing procedures/definitions in use?
- checked out everything in DTR$EXAMPLES
- took training?
- got peer advice or hired a consultant
- Googled ?

So after all that, where are you and where do you want to be in simple terms ?

- Show us the domain/record you have perhaps reduced to a few relevant fields.

- Show the output you have, show us what you'd like it to look like.

- Use a TEXT attachment to convey the fine points, notably for than a few lines of output, or when spacing is important

Hope this helps some,
Hein van den Heuvel
(30 years of Datatrieve, last use last night :-).

RAVI KISHORE_1
Advisor

Re: DATATRIEVE HELP NEEDED

Thank you for giving a reply.

Please find the attachment to have a clear problem description.
Hein van den Heuvel
Honored Contributor

Re: DATATRIEVE HELP NEEDED

Much better.

Just use a VIRTUAL, COMPUTED BY field.

You can declare that on the fly as per below, or in the record.

In the record, which you failed to provide a sample definition for, you can make the compute by easier by creating subfields for POSTED_YY, POSTED_MMDD but the can hinder also.

Here is a sample scenario...

DTR> define record ledger_record
DFN> 01 ledger.
DFN> 03 LEDGER-KEY-TYPE PIC X.
DFN> 03 LEDGER-KEY-NUM-9 PIC 9(9).
DFN> 03 LEDGER-POSTED-DATE-ALPHA PIC X(6).
DFN> ;
[Record is 16 bytes long.]
DTR> define domain LEDGER-FILE using ledger_record on tmp.tmp;
DTR> fn$spawn
VRXHT1$ cre tmp.tmp
1199999999300301
2929999999300324
3993999999300420
1999499999300517
:
$ lo
Process HEIN_46228 logged out..
DTR> declare LEDGER-POSTED-DATE_HELPER COMPUTED BY FN$STR_EXTRACT (LEDGER-POSTED-DATE-ALPHA,1,2) - 20 +
[Looking for value expression]
CON> 100*FN$STR_EXTRACT (LEDGER-POSTED-DATE-ALPHA,3,4).
DTR> report LEDGER-FILE
RW> PRINT LEDGER-KEY-TYPE ("Key Type"),LEDGER-KEY-NUM-9 ("SUB Number"),
[Looking for next element in list]
RW> LEDGER-POSTED-DATE_HELPER ("Posted"/"Date") using 99/99/99
RW> end_report;
20-Aug-2010
Page 1
Posted
Key Type SUB Number Date

1 199999999 03/01/10
2 929999999 03/24/10
3 993999999 04/20/10
1 999499999 05/17/10
:
RAVI KISHORE_1
Advisor

Re: DATATRIEVE HELP NEEDED

Thank you,

This is useful for me i have one small problem i.e., after creating subfields for ledger-yy,ledger-mmdd could you please tell me how to combine and print them as MM/DD/YY inside the
Report and end-report statements.


I am trying different statements but not getting the slashes between them.

Hein van den Heuvel
Honored Contributor

Re: DATATRIEVE HELP NEEDED

learn to read.

Good luck,
Hein.
RAVI KISHORE_1
Advisor

Re: DATATRIEVE HELP NEEDED

Thanks for your time

Just now got it

solved by searching the documents.

Thank for the help.