DS vs fields to set data
  (1-replies, RPG IV)
Post your reply | Return to Forum  Refresh | ascending | descending
Author: Bob Cozzi Return to Forum  Refresh 2010-07-22 07.02.51
Of course 1 operation is less overhead than >1 operations. 
I would do this:

FsrcCompIn IF   E           K DISK    PREFIX('SRC.') 
F                                     EXTDESC('SRCCOMP') EXTFILE('SRCCOMP')
FsrcCompOutO  A E             Disk    PREFIX('OUT.') 
F                                     EXTDESC('SRCCOMP') EXTFILE('SRCCOMP')

D SRC       E DS                      EXTNAME(SRCCOMP) QUALIFIED INZ
D OUT       E DS                      EXTNAME(SRCCOMP) QUALIFIED INZ

 /free
       read srcCompIn SRC;
       DOW NOT %EOF();
            eval-corr  out = src;
            write srcCompOut OUT;
            read srcCompIn SRC;
       enddo;


Alternatively, this might work, if it does, it would be even better:

FsrcCompIn IF   E           K DISK    PREFIX('SRC.') 
F                                     EXTDESC('SRCCOMP') EXTFILE('SRCCOMP')
FsrcCompOutO    E             DISK    PREFIX('OUT.') 
F                                     EXTDESC('SRCCOMP') 

D SRC       E DS                      EXTNAME(SRCCOMP) QUALIFIED INZ

 /free
       read srcCompIn SRC;
       DOW NOT %EOF();
            write srcCompOut SRC;
            read srcCompIn SRC;
       enddo;
Author: SF00001 Return to Forum  Refresh 2010-07-22 00.58.09
Scenario: Create data from a source company database to one or more target 
companies.

In above situation when reading data from source and writing back to file for 
target with a number of fields is it better to set fields one by one or use an 
externally described data structure and move all fields in one operation. 
Would there be any performance improvement in one method over the other? 

SF
Your reply | top | Return to Forum | ascending | descending
      Name:
    
By pressing you agree to the
forum guidelines
      Note: Your message is limited to 3500 characters.