Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 22 Feb 2001 @ 14:58:37 GMT

  <Prev Next>   <<First <Prev

Subj:   Re: Multiset load restarts
From:   Geoffrey Rommel

I may be missing something here, but I think that an INMOD could indeed help. Since multiset tables will accept duplicate rows (i.e., rows in which ALL fields are the same as those of another row already in the table), you could easily load the same data two or three times.

You can take care of this at the cost of a little Assembler code. Your INMOD should call the SWAREQ macro to get the JFCB; then read through the JFCB to find the data set name of the input file. Then keep track of the number of records processed; every so often (say, every 1000 records, or every record if you like) write both the DSN and the number of records to a separate file. (This could be a file with just one record -- the most recent file -- or perhaps a VSAM file with one record per DSN. VSAM coding is ugly in Assembler, but if you have VISION:Report [Quikjob] installed, you could call its QUIKVSAM module, which is quite easy to use.) When you have to restart, your INMOD should open this separate file and see whether the file has already been processed in whole or in part. If it has, you skip the records that have already been processed and start with the next one.

Here's some very rough pseudocode:

      open main input file
      SWAREQ; read DSN from JFCB

      open checkpoint file
      (If there are many records in the file, find the most recent record for the input
        DSN; if there is only one record, read it.)
      if checkpoint file is empty
         set records_already_processed = 0
      else if dsname of input file = dsname from checkpoint file
         set records_already_processed = number from the checkpoint file
         set records_already_processed = 0
      end if

      for each record in file
         record_num = record_num + 1
         if record_num > records_already_processed
            pass the record to MultiLoad
            do nothing
         end if
         put (or update) record to checkpoint file
      end for

One more thing: what if somebody makes a second copy of the input file (or renames it) so that the DSN is different but the records are the same? Well, this technique would not solve that problem, but there may be no way of making absolutely sure on the MVS side short of keeping everything in a separate database!

I hope this helps.

W. Geoffrey Rommel

  <Prev Next>   <<First <Prev
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020