Dynamic Array Creation in Eazytrieve



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

Re: Dynamic Array Creation in Eazytrieve

Postby NicC » Thu Mar 10, 2011 8:21 pm

Why not let sort do the summation and the removal of duplicates? There are examples in the sort sections.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3026
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Dynamic Array Creation in Eazytrieve

Postby Zio69 » Thu Mar 10, 2011 8:37 pm

sjrcreation wrote:
Zio69 wrote:Unfortunately the array needs to be sorted by its key and no duplicates are allowed

hi Zio69 are you sure about the above.. :?:

with "older releases" (until 6.3-6.4) I'm 200% sure: if there's a duplicate or the tables aren't sorted you get a "A007 TABLE INPUT IS NOT IN SEQUENCE - file-name" error (see Reference Guide - Appendix B - Diagnostic). If you were talking about COBOL, then of course there's no SYSTEM error... but try a SEARCH ALL on an array that is not in sequence and tell me what happens! ;)

sjrcreation wrote:so what will be the best approach for this ??

As BillyBoyo said, Synchronized processing... something like:

SORT file1 TO VFILE1 USING sort-key1
SORT file2 TO VFILE2 USING sort-key2
*
JOB INPUT (VFILE1 KEY sort-key1 VFILE2 KEY sort-key2)
IF MATCHED
 AMOUNT1 = AMOUNT1 + AMOUNT2
 PUT output-file FROM VFILE1
ELSE
   IF FILE1
      PUT output-file  FROM VFILE2
   END-IF
END-IF


where VFILEn is a VIRTUAL file with the same layout as the corresponding "phisical" file. BTW, when 2 or more files have the same layout, you only need to code the fields int the FIRST file; afterwards you can code COPY. I.e.
FILE VFILE1 VIRTUAL F(xx)
COPY FILE1
Zio69
 
Posts: 31
Joined: Wed Feb 16, 2011 7:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Dynamic Array Creation in Eazytrieve

Postby BillyBoyo » Thu Mar 10, 2011 9:06 pm

Hey, Nic, I got busted in the Syncsort forum for suggesting using Easytrieve Plus...

Syncsort uses Keywords, Easytrieve uses something more readable and you can process headers/trailers readily, produce reports of what you've done to the data in the format you want them, stuff like that. And you can knock together the code pretty quickly.

I do wonder if anyone has time to do a "race" between Easytrieve and whatever-sort so we can get an answer to the performance thing as well.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Dynamic Array Creation in Eazytrieve

Postby NicC » Thu Mar 10, 2011 10:04 pm

Hi Billy

I do not know if he has DFSORT, CASORT or whateverSORT. Also I do not know if he HAS TO use Eazytrieve - he does not say. Certainly with DFSORT you can produce all sorts of reports with headers and trailers and, with appropriate comments, even I can read the stuff - but the only ones I have seen have been written by me!! trying out the various options. A lot of manual reading but if properly commented should be adaptable easily to similar requirements. I will have to get back to that exercise as I didn't go through all possibilities and Frank keeps on adding new ones - soon ICETOOL will be able to tie my shoelaces for me!
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3026
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Dynamic Array Creation in Eazytrieve

Postby BillyBoyo » Fri Mar 11, 2011 12:02 am

Yes, it does look they have added a lot of extra functionality to various SORTs. I found a bunch of old "reference cards" of mine the other day. I have a SYNCSORT pocket reference dated 1982. In those days, sorts did sorts and merges.

I can understand they want to extend them (not so many new sites to offer them to, so higher competition and having to encroach on other areas to make an extra buck or two) but why don't they admit it, and make it (all the keyword parameters) look a bit more like a "real" language? They could even support both, for backwards-compatability. Perhaps I should patent this idea before they can read it... And perhaps I should look at the DFSORT forum (I've never managed to use IBM's sort, always SYNCSORT or CA-SORT) to see if they've already done it...
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Dynamic Array Creation in Eazytrieve

Postby sjrcreation » Fri Mar 11, 2011 9:55 am

ok. :!:
little confused .
Thanks for your respond.
sjrcreation
 
Posts: 30
Joined: Sat Dec 11, 2010 9:44 am
Has thanked: 0 time
Been thanked: 0 time

Re: Dynamic Array Creation in Eazytrieve

Postby dick scherrer » Fri Mar 11, 2011 10:42 am

Hello,

I do wonder if anyone has time to do a "race" between Easytrieve and whatever-sort so we can get an answer to the performance thing as well.
Both DFSORT and Syncsort "outrun" Easytrieve for "big file" work. Easytrieve will also use more CPU.

In those days, sorts did sorts and merges.
In those days, Syncsort also had reporting capability.

little confused .
Thanks for your respond.
You're welcome. Unfortunately topics sometimes take a diversion . . .

What has you confused?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Previous

Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post