|
Let's see if I understand this. You have a 64 character file that will have multiple batches put in by different people from different screens. When someone has already put in some batches, and wants to a) change an existing batch or b) start a new batch, they are to be shown all existing batches they have personally entered. If they choose to change an existing batch, then they will get up a secondary screen showing the existing details of that batch. Is this right? Presuming it is, then I would have heaps of questions about - # of outstanding batches at one time - size of each batch - how long data will be kept for - how data will leave the flat file - batch numbering requirements - etc. On general principle though, I would proceed as follows. I would create a key in your spare area. Its contents would be someting like WSaaaabbbb, where WS is the workstation, aaaa is the batch number, and bbbb is the sequence number. I would use sequence 0000 for all batch headers, and sequences 0001 and above for the details. When filling the first screen, I would therefore be using WS as the SETLL/COMP area, and only display those records with a 0000 as the sequence, and when filling the second I would use WSaaaa, and display all records of sequence 0001 or more. As you write each detail record, you just add 1 to the highest number so far, and use that. The batch numbering would be from 0001 up. To find what batch to use, you can either read all records to find the first available batch number, or use an alternate key on the aaaa value, and use SETGT & READP to find the last batch number, then add 1. The methodology depends a lot on questions such as how big the batches are, and whether the transactions will be totally cleared from the file, or on a btach by batch basis. I would strongly suggest against using anything like RRN, as this can get REALLY messy. Another concern would be if someone takes ATTN 1, and starts another session. The last thing you want is to have the same batch being updated twice at the same time, that would really screw the sequence numbers around. Kathie wrote I am creating transactions in a 64 character flat file. Some of the records are Batch Hdr records (i.e. Positions 1-4 are 'B', '1234', etc.etc.) and some are detail records (i.e. Positions 1-16 are 'A', 'TAG123', 'PART123456', xxxx etc etc etc....). I have the last 13 positions of the record to hold whatever I wish. I need to be able to retrieve the records later in the program for 'REVIEW'. On one screen, I need to ROLL through the Header records and allow the user to modify them, on another screen, I need to ROLL through the Detail records for the associated Header record to allow modification of them. The records in the transaction file will be written by different workstations. I am only supposed to show the records written by the workstation the user is using. The program must run in 36 mode, and later will be 'converted' (by a package) to a 400 program. Soooooo, I am thinking I must use my 13 positions to store Batch (4) Batch Start RRN (4) Prev Dtl Rcd RRN (4) and a 1? position WSID. I need to get the RRN of the record - how? the WSID of the record - how? Any help is most GREATLY appreciated.
As an Amazon Associate we earn from qualifying purchases.
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.