ANOTHER IT CO

Loading Fact Tables

program listparameters
*
***********************************************************
* Copyright 2001 Another IT Co, Chuck Smith
*
* Permission to use this software is conditional upon you
* agreeing to the disclaimer and license terms.  By installing
* or using the software you consent to be bound by and become
* party to this agreement.
* 
* Chuck Smith ("developer") hereby grants you ("user") a 
* non-exclusive personal license to use this software subject 
* to the following disclaimer, terms and conditions:
* 
* user agrees not to distribute, reproduce, transmit or
* transfer, in whole or in part, the software or its
* documentation without express written permission
* from the developer.
* 
* DISCLAIMER: This software is provided on an "as-is"
* basis without warranty of any kind.
* 
* Developer specifically disclaims any other warranty,
* express or implied, including any warrent of 
* merchantability or fitness for a particular purpose.
* In no event shall developer be liable for any 
* consequential, indirect, special or incidental damages,
* even if developer has been advised by user of the 
* possibility of such potential loss or damage.  User 
* agrees to hold developer harmless from and against any
* and all claims, losses, liabilities and expenses.
***********************************************************
*
true = 1
false = 0
*
open '','DS_JOBS' to DSJOBS then
  *
  clearselect
  * select DSJOBS
  execute 'SELECT DS_JOBS BY NAME NO.PAGE'
  *
  eof = false
  loop
    readnext onejob else eof = true
  until eof = true
    *
    crt 'Processing job: ':trim(onejob)
    read onejobrec from DSJOBS,onejob then
      *
      onejobnumber = onejobrec<5>
      crt space(2):'Processing job number: ':onejobnumber
      jobfile = 'DS_JOB':onejobnumber
      *
      open '',jobfile to DSJOB then
        *
        gosub getparms:
        *
        close DSJOB
      end else
        crt 'Unable to open ':jobfile:' for job ':onejob:'.'
        crt
      end
      *
    end else
      crt 'Can not read DS_JOBS record for ':onejob:'.'
      crt
    end
    *
  repeat
  *
  close DSJOBS
end else
  crt 'Unable to open DS_JOBS.'
  goto eop:
end
*
eop:
crt 'Done.'
stop
*************************************************************
getparms:


  * read root record
  read rootrecord from DSJOB,'ROOT' then
    * get field 14
    numberofparms = field(rootrecord<13,1>,'/',2)
    parameters = rootrecord<14>


    * display field 14
    for i = 1 to numberofparms
      crt space(5):trim(parameters<1,i>)
    next i
    crt


  end else
    crt 'Unable to read ROOT record for job ':onejob:' in ':jobfile:'.'
  end


  return


*************************************************************
end

Copyright 2016 Another IT Co