
gcsort_gentestcase

The question is : How can check if my sorted file is really sorted ? ?
The answer is   : Write Cobol program that reads data file and checks the value of the keys.

The goal of this project is generate file for sort and check that output of sort is correctly order.
This tool is created for support testcase GCSORT.
Inspired by "FAQ and How-To" 5.54   What is GCSORT? of GnuCOBOL( program-id. verify. ).

gcsort_gentestcase creates:
    Data File               # Input for gcsort
    File TAKE command       # command for sort 
    Program COBOL  Data     # for check data generated (Read file at end)
    Program COBOL  Sort     # for check sorted data
    Script for execution    # Contains a sequence of operation:  
                                 1) Compile COBOL  Data
                                 2) Compile COBOL  Sort
                                 3) Setting value for file name
                                 4) Execute Cobol program Data
                                 5) Execute sort (gcsort TAKE filename)
                                 6) Execute Cobol program Sort
                                 Every step check return code of execution.
                                 When Cobol program Sort find a error, display the values of current record, 
                                 revious record and stop excution.
  
**
Requirements
       gcc    - c compiler installed
       cobc   - GnuCOBOL installed
       gcsort - installed
**
Installation:
1) Check/Make folder in gcsort_gentestcase
        subfolder:
              bin      - executable [will be created]
              config   - config file (structure of file)  [will be created]
              files    - file output
              script   - script for execution
              scr      - source Cobol
              take     - file script for GCSORT.
              
2) Compile gcsort_gentestcase
    After checkout in folder build_linux modify 
    1) compile.sh # change the paths according to your needs
    2) Makefile   # change the paths according to your needs / local setup
    3) chmod 777 compile.sh  # enable for execution only for linux
    
    Copy compile.sh file
    For linux   :     ./compile.sh 
	For windows :     make

3) Create modules   
    in ../script
    chmod 777 execgen.sh
    in ../config
    ../bin/gcsort_gentestcase --gen  #Create file config < example_gen.cfg> with all entries 

4) Rename and modify  file  example_gen.cfg

5) Verify/Copy gcsort executable in bin folder
        
6) Execute generator
    in ../script
    ./execgen  <filename config>   # example : ./execgen.sh  example_gen.cfg (parameter name is config file)

    The script execgen
    Make file data, 
    Generate File TAKE command for GCSORT, 
    Program COBOL for check data generated, 
    Program COBOL for check data sorted,
    Generate script for execution
 

7) Run process in Linux environment
     in /script folder execute
     
    ./<script_name>.sh             # example  : ./execgen.sh 
  
  This script <script_name>.sh :
    compile program for check data generated  (name present in config file)
    compile program for check data sorted     (name present in config file)
    Set variable FGENFILE  with pathname and filename for file generated  (name present in config file)
    Execute COBOL program for check data produced by gcsort_gentestcase
    Execute GCSORT with parameter name of file TAKE for sort (name present in config file) 
    Set variable FGENFILE  with pathname and filename for file sorted  (name present in config file)
    Execute Cobol program for check file sorted 
    
7) Run process in Windows environment
     in \script folder execute
     
     <script_name>.bat             # example  : execgen.bat 
     This script is the same of linux.
