SORT using ALTSEQ
ASCII & EBCDIC Collating Sequences
  Table of Contents  v-19.00.00 - tc07sr01.htm 
  Introduction
  Execute
  JCL Members, Sort using ALTSEQ
  ASCII Records, EBCDIC Sequence
  EBCDIC Records, ASCII Sequence
  CMD Files, Sort using ALTSEQ
  ASCII Records, EBCDIC Sequence
  EBCDIC Records, ASCII Sequence
  Prepare
  Make Test Files, ASCII Platform
  Make Test Files, EBCDIC Platform
  Technical Details
  SORT Specifications using ALTSEQ
  ASCII-encoded & EBCDIC-sequence
  EBCDIC-encoded & ASCII-sequence
  Record Structure for the Test File
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

The primary objective of this test case is to describe and demonstrate how to use the alternate collating or ALTSEQ function of the SORT Utility program to do the following.

1. Arrange the records of an ASCII-encoded file into an EBCDIC sequence.
2. Arrange the records of an EBCDIC-encoded file into an ASCII sequence.

 

A secondary objective is to describe and demonstrate how to create a file to be used for testing the ALTSEQ function of the mainframe SORT program and the Micro Focus SORT program.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Execute

Most of the time users want the records in a file to be sequenced based on the character content (i.e. A-Z and 0-9) of a field or fields within a record. This character representation is based on the encoding schema (usually ASCII or EBCDIC) in use when a file is created and subsequently updated. Since the encoding schemas use different, underlying binary values for character set definitions the ASCII encoded files will be sorted into a different sequence than an EBCDIC encoded file.

Occasionally, the need may arise to sort an ASCII-encoded file into an EBCDIC collating sequence or vice versa. This document will describe and demonstrate how to accomplish this task.

This test case includes JCL members for execution in a "Mainframe-oriented" environment and CMD files for executing in a Windows environment.

Table of Contents Previous Section Next Section JCL Members, Sort using ALTSEQ

The following sub-sections describe the JCL Members that are used to execute the test cases in a "Mainframe-oriented" environment. This includes a Mainframe System with ZOS or a Linux, UNIX or Windows System with Micro Focus Enterprise Server.

Table of Contents Previous Section Next Section ASCII Records, EBCDIC Sequence

The following JCL Member (SRIAOEJ1.jcl) will prepare the resources then SORT an ASCII-encoded file with the records arranged in a random sequence (based on the character in position 5 of the record) into an ASCII-encoded file with the records arranged in an EBCDIC sequence.

//SRIAOEJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2019 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Sort ASCII-encoded file into an EBCDIC collating sequence.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* This example will sort an ASCII-encoded sequential file using
//* the ALTSEQ function of SORT to create an ASCII-encoded output
//* file that is arranged in an EBCDIC collating sequence.
//*
//* Note; Refer to SRTMKAJ8.jcl to create the data files to be used
//* as SORTIN.
//*
//* Step 1, DELSEQS1 will delete any previously created files.
//* Step 2, SRTSEQS3 will sort the file.
//*
//* CAUTION! Since the ALTSEQ is defined at the binary (or hexadecimal)
//*          level and step 3 will only work for ASCII-encoded files.
//*
//* This job uses sorting specifications (SYSIN) that are defined in
//* a Partitioned Data Set Member (PDSM).
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//* 1. Demonstrate how to use IEFBR14 with DD statements to delete
//*    files that have been created by a previous execution of this
//*    job.
//* 2. Demonstrate how to use the SORT program to sort a file based
//*    on the value in position five (5) of each record.
//*    This example uses a Partitioned Data Set Member (PDSM) to define
//*    the SORT specifications that include an ALTSEQ Table to sort
//*    an ASCII-encoded data file into an EBCDIC collating sequence.
//*
//* *******************************************************************
//* Step 1 of 2,
//*      Delete any previously created file...
//*
//DELSEQS1 EXEC PGM=IEFBR14
//DDSAASC1 DD  DSN=SIMOTIME.DATA.DDSAASC1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 2,
//*      Sort the file, read an ASCII-encoded file and create an output
//*      file that is arranged in an EBCDIC collating sequence.
//*
//SRTSEQS3 EXEC PGM=SORT,
//             REGION=1024K
//SYSIN    DD  DSN=SIMOTIME.PDS.PARMLIB(SRTQIAOE),DISP=SHR
//SORTIN   DD  DSN=SIMOTIME.DATA.DDSUASC1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.DDSAASC1,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//

Table of Contents Previous Section Next Section EBCDIC Records, ASCII Sequence

The following JCL Member (SRIEOAJ1.jcl) will prepare the resources then SORT an EBCDIC-encoded file with the records arranged in a random sequence (based on the character in position 5 of the record) into an EBCIDC-encoded file with the records arranged in an ASCII sequence.

//SRIEOAJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*        This program is provided by SimoTime Technologies          *
//*           (C) Copyright 1987-2019 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Sort EBCDIC-encoded file into an ASCII collating sequence.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* This example will sort an EBCDIC-encoded sequential file using
//* the ALTSEQ function of SORT to create an EBCDIC-encoded output
//* file that is arranged in an ASCII collating sequence.
//*
//* Note; Refer to SRTMKEJ8.jcl to create the data files to be used
//* as SORTIN.
//*
//* Step 1, DELSEQS1 will delete any previously created files.
//* Step 2, SRTSEQS3 will sort the file.
//*
//* CAUTION! Since the ALTSEQ is defined at the binary (or hexadecimal)
//*          level and step 3 will only work for ASCII-encoded files.
//*
//* This job uses sorting specifications (SYSIN) that are defined in
//* a Partitioned Data Set Member (PDSM).
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//* 1. Demonstrate how to use IEFBR14 with DD statements to delete
//*    files that have been created by a previous execution of this
//*    job.
//* 2. Demonstrate how to use the SORT program to sort a file based
//*    on the value in position five (5) of each record.
//*    This example uses a Partitioned Data Set Member (PDSM) to define
//*    the SORT specifications that include an ALTSEQ Table to sort
//*    an ASCII-encoded data file into an EBCDIC collating sequence.
//*
//* *******************************************************************
//* Step 1 of 2,
//*      Delete any previously created file...
//*
//DELSEQS1 EXEC PGM=IEFBR14
//DDSAASC1 DD  DSN=SIMOTIME.DATA.DDSAEBC1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 2,
//*      Sort the file, read an ASCII-encoded file and create an output
//*      file that is arranged in an EBCDIC collating sequence.
//*
//SRTSEQS3 EXEC PGM=SORT,
//             REGION=1024K
//SYSIN    DD  DSN=SIMOTIME.PDS.PARMLIB(SRTQIEOA),DISP=SHR
//SORTIN   DD  DSN=SIMOTIME.DATA.DDSUEBC1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.DDSAEBC1,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//

Table of Contents Previous Section Next Section CMD Files, Sort using ALTSEQ

The following sub-sections describe the CMD files that are used to execute the test cases on a Windows System with Micro Focus Enterprise Server.

Table of Contents Previous Section Next Section ASCII Records, EBCDIC Sequence

The following CMD file (SRIAOEW1.cmd) will set the environment then SORT an ASCII-encoded file with the records arranged in a random sequence (based on the character in position 5 of the record) into an ASCII-encoded file with the records arranged in an EBCDIC sequence.

@echo OFF
rem  * *******************************************************************
rem  *               SRIAOEW1.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Sort ASCII-encoded file into an EBCDIC collating sequence
rem  * Author - SimoTime Technologies
rem  * Date   - January 01, 1989
rem  *
rem  * This example will sort an ASCII-encoded sequential file using
rem  * the ALTSEQ function of SORT to create an ASCII-encoded output
rem  * file that is arranged in an EBCDIC collating sequence.
rem  *
rem  * Note; Refer to SRTMKAJ8.jcl to create the data files to be used
rem  * as SORTIN.
rem  *
rem  * Step 1, DELSEQS1 will delete any previously created files.
rem  * Step 2, SRTSEQS3 will sort the file.
rem  *
rem  * CAUTION! Since the ALTSEQ is defined at the binary (or hexadecimal)
rem  *    level and step 3 will only work for ASCII-encoded files.
rem  *
rem  * This job uses sorting specifications (SYSIN) that are defined in
rem  * a Partitioned Data Set Member (PDSM).
rem  *
rem  * This set of programs will run on a mainframe under MVS or on a
rem  * Personal Computer with Windows and Micro Focus Mainframe Express.
rem  *
rem  * 1. Demonstrate how to use IEFBR14 with DD statements to delete
rem  *    files that have been created by a previous execution of this
rem  *    job.
rem  * 2. Demonstrate how to use the SORT program to sort a file based
rem  *    on the value in position five (5) of each record.
rem  *    This example uses a Partitioned Data Set Member (PDSM) to define
rem  *    the SORT specifications that include an ALTSEQ Table to sort
rem  *    an ASCII-encoded data file into an EBCDIC collating sequence.
rem  *
rem  * *******************************************************************
rem  * Step 1 of 2  Set the global environment variables...
rem  *              Delete any previously created file...
rem  * *******************************************************************
     set CmdName=SRIAOEW1
     call ..\Env1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%, User is %USERNAME%"
     set DDSUASC1=%BaseLib1%\DATA\APPL\SIMOTIME.DATA.DDSUASC1.dat
     set DDSEASC1=%BaseLib1%\DATA\APPL\SIMOTIME.DATA.DDSEASC1.dat
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_SRIAOEW1.txt
     if exist %DDSEASC1% del %DDSEASC1%
rem  *
rem  * *******************************************************************
rem  * Step 2 of 2  Sort the file...
rem  *
     call SimoNOTE "Identify Sort the File"
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_SRIAOEW1_SORT.txt
     set SYSIN=%BaseLib1%\PARMLIB\SRTQIAOE.ctl
     set SORTIN=%DDSUASC1%
     set SORTOUT=%DDSEASC1%
     MFSORT take %SYSIN% use %SORTIN% RECORD F,80 ORG SQ GIVE %SORTOUT% RECORD F,80 ORG SQ
     if ERRORLEVEL = 1 set JobStatus=0020
     set SYSOUT=%SYSOUTSAVE%
     if not "%JobStatus%" == "0000" goto :EOJNOK
     if exist %DDSEASC1% goto :EOJAOK
        call SimoNOTE "ABENDING JobStep EOJNOK, Sort Failure..."
        goto :EOJNOK
rem  *
rem  * *******************************************************************
rem  *
:EOJNOK
     call SimoNOTE "ABENDING JobName %CmdName%, JobStatus %JobStatus%"
     call SimoNOTE "ABENDING Message JobStatus %JobStatus%"
     goto :EOJEND
:EOJAOK
     if exist %DDSEASC1% call SimoNOTE "Produced DataSet %DDSEASC1%"
     call SimoNOTE "Finished JobName %CmdName%"
:EOJEND
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section EBCDIC Records, ASCII Sequence

The following CMD file (SRIEOAW1.cmd) will set the environment then SORT an EBCDIC-encoded file with the records arranged in a random sequence (based on the character in position 5 of the record) into an EBCDIC-encoded file with the records arranged in an ASCII sequence.

@echo OFF
rem  * *******************************************************************
rem  *               SRIEOAW1.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Sort EBCDIC-encoded file into an ASCII collating sequence
rem  * Author - SimoTime Technologies
rem  * Date   - January 01, 1989
rem  *
rem  * This example will sort an EBCDIC-encoded sequential file using
rem  * the ALTSEQ function of SORT to create an EBCDIC-encoded output
rem  * file that is arranged in an ASCII collating sequence.
rem  *
rem  * Note; Refer to SRTMKEJ8.jcl to create the data files to be used
rem  * as SORTIN.
rem  *
rem  * Step 1, DELSEQS1 will delete any previously created files.
rem  * Step 2, SRTSEQS3 will sort the file.
rem  *
rem  * CAUTION! Since the ALTSEQ is defined at the binary (or hexadecimal)
rem  *    level and step 3 will only work for EBCDIC-encoded files.
rem  *
rem  * This job uses sorting specifications (SYSIN) that are defined in
rem  * a Partitioned Data Set Member (PDSM).
rem  *
rem  * This set of programs will run on a mainframe under MVS or on a
rem  * Personal Computer with Windows and Micro Focus Mainframe Express.
rem  *
rem  * 1. Demonstrate how to use IEFBR14 with DD statements to delete
rem  *    files that have been created by a previous execution of this
rem  *    job.
rem  * 2. Demonstrate how to use the SORT program to sort a file based
rem  *    on the value in position five (5) of each record.
rem  *    This example uses a Partitioned Data Set Member (PDSM) to define
rem  *    the SORT specifications that include an ALTSEQ Table to sort
rem  *    an EBCDIC-encoded data file into an ASCII collating sequence.
rem  *
rem  * *******************************************************************
rem  * Step 1 of 2  Set the global environment variables...
rem  *              Delete any previously created file...
rem  * *******************************************************************
     set CmdName=SRIEOAW1
     call ..\Env1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting JobName %CmdName%, User is %USERNAME%"
     set DDSUEBC1=%BaseLib1%\DATA\APPL\SIMOTIME.DATA.DDSUEBC1.dat
     set DDSAEBC1=%BaseLib1%\DATA\APPL\SIMOTIME.DATA.DDSAEBC1.dat
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_SRIAOEW1.txt
     if exist %DDSAEBC1% del %DDSAEBC1%
rem  *
rem  * *******************************************************************
rem  * Step 2 of 2  Sort the file...
rem  *
     call SimoNOTE "Identify Sort the File"
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_SRIEOAW1_SORT.txt
     set SYSIN=%BaseLib1%\PARMLIB\SRTQIEOA.ctl
     set SORTIN=%DDSUEBC1%
     set SORTOUT=%DDSAEBC1%
     MFSORT take %SYSIN% use %SORTIN% RECORD F,80 ORG SQ GIVE %SORTOUT% RECORD F,80 ORG SQ
     if ERRORLEVEL = 1 set JobStatus=0020
     set SYSOUT=%SYSOUTSAVE%
     if not "%JobStatus%" == "0000" goto :EOJNOK
     if exist %DDSAEBC1% goto :EOJAOK
        call SimoNOTE "ABENDING JobStep EOJNOK, Sort Failure..."
        goto :EOJNOK
rem  *
rem  * *******************************************************************
rem  *
:EOJNOK
     call SimoNOTE "ABENDING JobName %CmdName%, JobStatus %JobStatus%"
     call SimoNOTE "ABENDING Message JobStatus %JobStatus%"
     goto :EOJEND
:EOJAOK
     if exist %DDSAEBC1% call SimoNOTE "Produced DataSet %DDSAEBC1%"
     call SimoNOTE "Finished JobName %CmdName%"
:EOJEND
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Prepare

This section describes the tasks that are necessary to create an environment and the test files that are required to execute the primary tasks.

Table of Contents Previous Section Next Section Make Test Files, ASCII Platform

The following job (SRTMKAJ8.jcl) is designed to run under control of a Micro Focus Enterprise Server Instance that has been configured for an ASCII-encoded environment.

//SRTMKAJ8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       This JCL Member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2019 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Create the ASCII and EBCDIC encoded test files.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* Step 1, DELSEQS1 will delete any previously created files.
//* Step 2, CRTSEQS2 will create a new ASCII-encoded test file.
//* Step 3, CVTSEQS3 will read ASCII file and create EBCDIC file.
//*
//* CAUTION! This job is expected to run on a Micro Focus server that
//*          has been configured for an ASCII-encoded environment.
//*
//* 1. Demonstrate how to use IEFBR14 with DD statements to delete
//*    files that have been created by a previous execution of this
//*    job.
//* 2. Demonstrate how to use IEBGENER to create and populate a new
//*    record sequential file with eighty (80) byte fixed length
//*    records.
//* 3. Demonstrate how to use a conversion program to read a file with
//*    ASCII-encoded records and create a new file with EBCDIC-encoded
//*    records.
//*
//* *******************************************************************
//* Step 1 of 3,
//*      Delete any previously created file...
//*
//DELSEQS1 EXEC PGM=IEFBR14
//DDSUASC1 DD  DSN=SIMOTIME.DATA.DDSUASC1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//DDSUEBC1 DD  DSN=SIMOTIME.DATA.DDSUEBC1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 3,
//*      Create and populate a new ASCII-encoded test file...
//*
//CRTSEQS2 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  *
000   ...1....:....2....:....3....:....4....:....5....:....6....:....7.
001 A C1 1100 0001 41 0100 0001
002 B C2 1100 0010 42 0100 0010
003 0 F0 1111 0000 30 0011 0000
004 C C3 1100 0011 43 0100 0011
005 a 81 1000 0001 61 0110 0001
006 b 82 1000 0010 62 0110 0010
007 1 F1 1111 0001 31 0011 0001
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.DDSUASC1,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//*
//* *******************************************************************
//* Step 3 of 3,
//*      Create and populate a new EBCDIC-encoded test file...
//*      Read the ASCII-encoded file and create a new file that is
//*      an EBCDIC-encoded file.
//*
//CVTSEQS3 EXEC PGM=CV80ARER
//SYSOUT   DD  SYSOUT=*
//GETRS080 DD  DSN=SIMOTIME.DATA.DDSUASC1,DISP=SHR
//PUTRS080 DD  DSN=SIMOTIME.DATA.DDSUEBC1,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//

Table of Contents Previous Section Next Section Make Test Files, EBCDIC Platform

The following job (SRTMKEJ8.jcl) is designed to run under control of a Micro Focus Enterprise Server Instance that has been configured for an EBCDIC-encoded environment or a Mainframe running ZOS.

//SRTMKEJ8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       This JCL Member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2019 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Create EBCDIC-encoded convert to ASCII-encoded test files.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* Step 1, DELSEQS1 will delete any previously created files.
//* Step 2, CRTSEQS2 will create a new EBCDIC-encoded test file.
//* Step 3, CVTSEQS3 will read EBCDIC file and create ASCII file.
//*
//* CAUTION! This job is expected to run on a Micro Focus server that
//*          has been configured for an ASCII-encoded environment.
//*
//* 1. Demonstrate how to use IEFBR14 with DD statements to delete
//*    files that have been created by a previous execution of this
//*    job.
//* 2. Demonstrate how to use IEBGENER to create and populate a new
//*    record sequential file with eighty (80) byte fixed length
//*    records.
//* 3. Demonstrate how to use a conversion program to read a file with
//*    EBCDIC-encoded records and create a new file with ASCII-encoded
//*    records.
//*
//* *******************************************************************
//* Step 1 of 3,
//*      Delete any previously created file...
//*
//DELSEQS1 EXEC PGM=IEFBR14
//DDSUASC1 DD  DSN=SIMOTIME.DATA.DDSUASC1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//DDSUEBC1 DD  DSN=SIMOTIME.DATA.DDSUEBC1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 3,
//*      Create and populate a new EBCDIC-encoded test file...
//*
//CRTSEQS2 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  *
000   ...1....:....2....:....3....:....4....:....5....:....6....:....7.
001 A C1 1100 0001 41 0100 0001
002 B C2 1100 0010 42 0100 0010
003 0 F0 1111 0000 30 0011 0000
004 C C3 1100 0011 43 0100 0011
005 a 81 1000 0001 61 0110 0001
006 b 82 1000 0010 62 0110 0010
007 1 F1 1111 0001 31 0011 0001
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.DDSUEBC1,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//*
//* *******************************************************************
//* Step 3 of 3,
//*      Create and populate a new ASCII-encoded test file...
//*      Read the EBCDIC-encoded file and create a new file that is
//*      an ASCII-encoded file.
//*
//CVTSEQS3 EXEC PGM=CV80ERAR
//SYSOUT   DD  SYSOUT=*
//GETRS080 DD  DSN=SIMOTIME.DATA.DDSUEBC1,DISP=SHR
//PUTRS080 DD  DSN=SIMOTIME.DATA.DDSUASC1,DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//

Table of Contents Previous Section Next Section Technical Details

This section provides information about additional components required or referenced in this sample suite of programs or test case.

Table of Contents Previous Section Next Section SORT Specifications using ALTSEQ

The sort specifications used in the examples for this test case are stored as Partitioned Data Set Members (PDSM's).

Table of Contents Previous Section Next Section ASCII-encoded & EBCDIC-sequence

The following Partitioned Data Set Member (SRTQIAOE.ctl) contains the sort specifications to sort an ASCII-encoded file based on the content in position 5 of a record into an EBCDIC collating sequence using the ALTSEQ table.

* Sort using a User-Defined Alternate Collating Sequence, this table
* will sort an ASCII-encoded file into an EBCDIC sequence.
* ..:....1....:....2....:....3....:....4....:....5....:....6....:....7.
  SORT FIELDS=(5,1,AQ,A,1,3,AQ,A)
  ALTSEQ CODE=(2040,215A,227F,237B,245B,256C,2650,277D,284D,295D,2A5C,
               2B4E,2C6B,2D60,2E4B,2F61,30F0,31F1,32F2,33F3,34F4,35F5,
               36F6,37F7,38F8,39F9,3A7A,3B5E,3C4C,3D7E,3E6E,3F6F,407C,
               41C1,42C2,43C3,44C4,45C5,46C6,47C7,48C8,49C9,4AD1,4BD2,
               4CD3,4DD4,4ED5,4FD6,50D7,51D8,52D9,53E2,54E3,55E4,56E5,
               57E6,58E7,59E8,5AE9,5BBA,5CE0,5DBB,5EB0,5F6D,6079,6181,
               6282,6383,6484,6585,6686,6787,6888,6989,6A91,6B92,6C93,
               6D94,6E95,6F96,7097,7198,7299,73A2,74A3,75A4,76A5,77A6,
               78A7,79A8,7AA9,7BC0,7C4F,7DD0,7EA1,8020,A24A,A3B1,A5B2,
               A66A,AC5F)

Table of Contents Previous Section Next Section EBCDIC-encoded & ASCII-sequence

The following Partitioned Data Set Member (SRTQIEOA.ctl) contains the sort specifications to sort an EBCDIC-encoded file based on the content in position 5 of a record into an ASCII collating sequence using the ALTSEQ table.

* Sort using a User-Defined Alternate Collating Sequence, this table
* will sort an EBCDIC-encoded file into an ASCII sequence.
* ..:....1....:....2....:....3....:....4....:....5....:....6....:....7.
  SORT FIELDS=(5,1,AQ,A,1,3,AQ,A)
  ALTSEQ CODE=(4020,5A21,7F22,7B23,5B24,6C25,5026,7D27,4D28,5D29,5C2A,
               4E2B,6B2C,602D,4B2E,612F,F030,F131,F232,F333,F434,F535,
               F636,F737,F838,F939,7A3A,5E3B,4C3C,7E3D,6E3E,6F3F,7C40,
               C141,C242,C343,C444,C545,C646,C747,C848,C949,D14A,D24B,
               D34C,D44D,D54E,D64F,D750,D851,D952,E253,E354,E455,E556,
               E657,E758,E859,E95A,BA5B,E05C,BB5D,B05E,6D5F,7960,8161,
               8262,8363,8464,8565,8666,8767,8868,8969,916A,926B,936C,
               946D,956E,966F,9770,9871,9972,A273,A374,A475,A576,A677,
               A778,A879,A97A,C07B,4F7C,D07D,A17E,2080,4AA2,B1A3,B2A5,
               6AA6,5FAC)

Table of Contents Previous Section Next Section Record Structure for the Test File

The following COBOL Copy Member (SRT080B1.cpy) defines the record structure for the test files used in this suite of jobs.

      *****************************************************************
      *               SRT080B1.CPY - a COBOL Copy File                *
      * Copy File to define record structure for ASCII/EBCDIC Testing *
      *         Copyright (C) 1987-2019 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *              Provided by SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
       01  SRT080-RECORD.
           05  SRT080-ENTRY-SEQ        PIC X(3).
           05  FILLER                  PIC X.
           05  SRT080-CHARACTER        PIC X.
           05  FILLER                  PIC X.
           05  SRT080-EBC-HEX-CODE     PIC X(2).
           05  FILLER                  PIC X.
           05  SRT080-EBC-BIN-CODE     PIC X(9).
           05  FILLER                  PIC X.
           05  SRT080-ASC-HEX-CODE     PIC X(2).
           05  FILLER                  PIC X.
           05  SRT080-ASC-BIN-CODE     PIC X(9).
           05  FILLER                  PIC X(49).
      *
      ***  SRT080B1 - End-of-Copy File - - - - - - - - - - - SRT080B1 *
      *****************************************************************
      *

1. SRT080-ENTRY-SEQ - this is a three (3) digit field that contains the sequence of entry number (or record number) when the file was created.
2. SRT080-CHARACTER - This is a one (1) character field that contains the display text that would be a letter, number or special character.
3. SRT080-EBC-HEX-CODE - This is a two (2) byte field that contains the EBCDIC hexadecimal notation for the character. For example, the upper-case letter "A" would be x'C1'.
4. SRT080-EBC-BIN-CODE - This is a nine (9) byte field that contains the EBCDIC binary notation for the character. For example, the upper-case letter "A" would be '1100 0001' (the embedded space is for ease of viewing).
5. SRT080-ASC-HEX-CODE - This is a two (2) byte field that contains the ASCII hexadecimal notation for the character. For example, the upper-case letter "A" would be x'41'.
6. SRT080-ASC-BIN-CODE - This is a nine (9) byte field that contains the ASCII binary notation for the character. For example, the upper-case letter "A" would be '0100 0001' (the embedded space is for ease of viewing).

 

 

The following shows a sample record the letter "A".

000 ...1....:....2....:....3....:....4....:....5....:....6....:....7.
001 A C1 1100 0001 41 0100 0001

Table of Contents Previous Section Next Section Summary

The primary objective of this test case is to describe and demonstrate how to use the alternate collating or ALTSEQ function of the SORT Utility program. This document may be used as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Contact or Feedback  section of this document.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.

SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.

Note: A SimoTime License is required for the items to be made available on a local system or server.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore How to sort files on an IBM Mainframe System using the ZOS SORT program or on a Windows System using the Micro Focus SORT program. This example documents and described the EBCDIC and ASCII encoding and case insensitive sorting. This example defines the syntax for ascending or descending sort by indiviual field positions.

Link to Internet   Link to Server   Explore a suite of sample programs that describes the ASCII and EBCDIC sorting or collating sequences and provides an example of programming logic that will work in an EBCDIC environment (i.e. Mainframe System with ZOS) but fail in an ASCII environment (i.e. Linux, UNIX or Windows with Micro Focus).

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

Link to Internet   Link to Server   Explore an Extended List of Software Technologies that are available for review and evaluation. The software technologies (or Z-Packs) provide individual programming examples, documentation and test data files in a single package. The Z-Packs are usually in zip format to reduce the amount of time to download.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connection.

This suite of programs and documentation is available for download. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Comments or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
Alternate Collating Sequence for Sort
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com