* Release Information
* MFG - P1 - 6.2.0
* CONVERT.STORE - Convert Store Information;*Audit Errors 09-05-96
  Version="Ver=6.2.269-1437117642"
********************************************************************************
* Copyright (C) 1998  Easton Sports, Inc.
*
*
*    C O N V E R T   S T O R E   I N F O R M A T I O N
*
*
*    Name:          CONV.STORE  Convert Store Information
*
*    Module:        P1 (People 1st Technology Group custom software)
*
*    Description:   Using information stored in TM 501, this program places the
*                   store number in the correct record of the CM file, F77.
*
*    Change log:    12/03/98 TA  Initial implementation.
*
*
*********************************************************************************
****************
*
* Define constants
*
****
* General constants
EQU FALSE               TO 0                     ;* False logical value
EQU TRUE                TO 1                     ;* True logical value
* TM attributes
EQU TM.Desc.AMC         TO 1                     ;* Description
* EDI.TRADING.PARTNERS attributes
EQU TP.Our_Cust_Number  TO 2                     ;* Union customer number
*
****************
*
* Define variables
*
****
*#* COPY COPY.TOOLS.BP STANDARD.VARIABLES.1 (REPLACING PGM.NAME BY CONV.STORE, FN.NAME BY CONV.STORE, IO.OPEN.OPTS BY TERM.DATA) ;*#* Copied Source Follows (11-03-98)
  $INCLUDE STANDARD.COMMON.VARIABLES FROM COPY.TOOLS.BP
  $INCLUDE STANDARD.COMMON.APP.PROGRAMS FROM COPY.TOOLS.BP
  $INCLUDE STANDARD.VARIABLES.END FROM COPY.TOOLS.BP
  PGM.NAME='COGNOS.BUDGETS'; FN.NAME ='COGNOS.BUDGETS'
     CALL IO.OPEN('TERM.DATA',PASSWORDS)
*#*
$INCLUDE CM FROM MFG.LAYOUTS                     ;* CM record
$INCLUDE CM.AMCS FROM MFG.LAYOUTS
****************
*
* Main program logic
*
****
GOSUB SETUP_PROGRAM                              ;* Initialize program
GOSUB GET_PARAMETERS
GOSUB OPEN_FILES
GOSUB SETUP_CONVERSION
GOSUB SELECT_RECORDS
GOSUB CONVERT_RECORDS
*
RETURN
****************
*
* Exit program
*
****
EXIT_PROGRAM:
CLOSE TM                                         ;* Close files
CLOSE CM
STOP
*
999:
ABORT_PROGRAM:
CALL SCREEN.MSG("Function ":FN.NAME:", program ":PGM.NAME:" aborted - call systems;B;H;E;A;#A61037")
****************
*
* Setup general program environment
*
****
SETUP_PROGRAM:
*BREAK OFF                                      ;* Disable BREAK key
*
RETURN
****************
*
* Get run-time parameters
*
****
GET_PARAMETERS:
*
*
RETURN
****************
*
* Open files
*
****
OPEN_FILES:
*#* OPEN 999 TM CM ;*#* Open Source Follows
IF PASSWORDS # '' THEN CALL SUB.PASSWORDS(PASSWORDS)
OPEN.ERROR = ''
OPEN '', 'ES_SALES_BUDGETS' TO ES_SALES_BUDGETS ELSE OPEN.ERROR<-1> = 'ES_SALES_BUDGETS'
IF OPEN.ERROR  # '' THEN
CALL SCREEN.MSG('OPEN ERRORS':AM:OPEN.ERROR)
GO 999
END
COM_FILES.LIST<1,-1> = 'ES_SALES_BUDGETS'
*#*
*
RETURN
****************
*
* Setup conversion
*
****
SETUP_CONVERSION:
*
*
RETURN
****************
*
* Select TM records
*
****
SELECT_RECORDS:
*
A.SEL = "SELECT TM WITH @ID LIKE "501*..."
*
EXECUTE A.SEL
*
RETURN
****************
*
* Convert store information
*
****
CONVERT_RECORDS:
A.EOF_FLAG = FALSE                               ;* Setup end-of-file flag
*
LOOP                                             ;* For each selected TM record...
  READNEXT ID ELSE A.EOF_FLAG = TRUE             ;*   Read next ID in list
  IF A.EOF_FLAG = FALSE THEN                     ;*   If not end-of-file...
    READ TM.REC FROM TM,ID ELSE                  ;*      Read GOALS record associated with ID
      CALL SCREEN.MSG(ID:' missing from TM file;b;h;e;a')
      GO TO ABORT_PROGRAM
    END
    GOSUB CONVERT_STORE                          ;*     Convert TM record
  END
UNTIL A.EOF_FLAG = TRUE DO REPEAT                ;*   Go on to next record
*
RETURN
****************
*
* Convert store record
*
****
CONVERT_STORE:
*
PRINT ID
*
RETURN
*
**************************************************************************************************
END
*
*
