JCL and Sorting Examples
 Syntax Checking and Execution
When technology complements business    Copyright © 1987-2012  SimoTime Enterprises  All Rights Reserved
  Table of Contents Version 11.12.01 
  Introduction
  Programming Objectives
  Programming Requirements
  Data Overview
  Data, Unsorted File Created by IEBGENER
  Data, Sorted File using EBCDIC Collating Sequence
  Data, Sorted "Case Insensitive" File using EBCDIC Collating Sequence
  Sort for EBCDIC Environment with EBCDIC Sequencing
  Job Overview for EBCDIC Environment
  JCL Member for EBCDIC Environment
  The JCL Member for Syntax Checking
  Sort for ASCII Environment with ASCII Sequencing
  Sort for ASCII Environment with EBCDIC Sequencing
  Summary
  Software Agreement and Disclaimer
  Downloads and Links to Similar Pages
  Downloads and Links, Internet Access Required
  Downloads and Links, Local Access
  Glossary of Terms
  Comments, Suggestions or Feedback
  Company Overview
The SimoTime Home Page

Introduction
(Next) (Previous) (Table-of-Contents)

This suite of programs provides JCL members that are coded to perform similar tasks when sorting EBCDIC or ASCII-encoded data files. The first JCL member provides an example of doing a "case-insensitive" sort for EBCDIC-encoded data files. The second JCL member uses the TYPRUN=SCAN parameter on the JOB statement which causes the member not to actually execute but does scan the JCL statements for proper syntax. The third JCL member provides an example of doing a "case-insensitive" sort for ASCII-encoded data files. The fourth JCL member provides an example of doing a "case-insensitive" sort for ASCII-encoded data files and will cause the numbers to be sorted after the letters (similar to the EBCDIC collating sequence).

The SORT steps will show how to use sort to copy a file or sort a file. An example of a case insensitive sort using an alternate collating table is included.

The JCL members were originally written and used on an "MVS (or z/OS) Mainframe. Currently, the JCL members may be used as MVS batch jobs on an IBM mainframe or with Micro Focus Mainframe Express (MFE) or Micro Focus ES/MTO Batch Facility on a PC with Windows. For more information about the Micro Focus technologies refer to http://www.microfocus.com ).

Programming Objectives
(Next) (Previous) (Table-of-Contents)

This example illustrates the following functions.

1 Describe and demonstrate how to syntax check a mainframe JCL member.
2 Describe and demonstrate how to use the IEBGENER utility program to create and populate a file.
3 Describe and demonstrate how to use the SORT program to copy a file.
4 Describe and demonstrate how to use the SORT program to sort a file.
5 Describe and demonstrate how to use the SORT program to sort a file using an alternate sorting sequence (this example does a "case insensitive" sort).
6 Describe and demonstrate how to use IEFBR14 to delete files.
  Describe and Demonstrate the Functions of the SORT and Utiity Programs

Programming Requirements
(Next) (Previous) (Table-of-Contents)

This suite of samples programs will run on the following platforms.

1 Executes on Windows/XP, Windows/7 or Windows Server 2008 using Micro Focus Server/Studio, Enterprise Edition.
2 May be ported to run on the Linux and UNIX platforms supported by Micro Focus Server/Studio, Enterprise Edition.
3 Originally developed and continues to run on an IBM Mainframe with MVS or ZOS
  Operating System Requirements

Data Overview
(Next) (Previous) (Table-of-Contents)

The input for this example is included in the job stream. The output of the individual steps will create simple sequential files. The input for the examples is included in the job stream. The output of the individual steps will create simple sequential files.

Data, Unsorted File Created by IEBGENER
(Next) (Previous) (Table-of-Contents)

The following is an example of a sequential file (JCLSCAN1.DAT) created by one of the job steps that use IEBGENER. The relative record sequence number is in positions 73-80. This file will be used by the following sort steps.

....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
026 AAA Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000010
025 bbb Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000020
024 CCC Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000030
023 ddd Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000040
022 EEE Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000050
021 fff Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000060
020 GGG Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000070
019 hhh Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000080
018 III Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000090
017 jjj Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000100
016 KKK Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000110
015 lll Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000120
014 MMM Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000130
036 999 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000140
035 888 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000150
034 777 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000160
033 666 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000170
032 555 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000180
031 444 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000190
030 333 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000200
029 222 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000210
028 111 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000220
026 000 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000230
013 nnn Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000240
012 OOO Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000250
011 ppp Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000260
010 QQQ Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000270
009 rrr Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000280
008 SSS Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000290
007 ttt Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000300
006 UUU Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000310
005 vvv Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000320
004 WWW Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000330
003 xxx Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000340
002 YYY Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000350
001 zzz Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000360

Data, Sorted File using EBCDIC Collating Sequence
(Next) (Previous) (Table-of-Contents)

The following is an example of the sequential file (JCLSCAN4.DAT) created as a result of sorting with the standard EBCDIC collating sequence (notice the lower case letters come first followed by upper case and then numbers). The sorting is done on positions 5-7.

....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
025 bbb Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000020
023 ddd Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000040
021 fff Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000060
019 hhh Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000080
017 jjj Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000100
015 lll Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000120
013 nnn Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000240
011 ppp Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000260
009 rrr Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000280
007 ttt Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000300
005 vvv Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000320
003 xxx Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000340
001 zzz Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000360
026 AAA Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000010
024 CCC Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000030
022 EEE Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000050
020 GGG Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000070
018 III Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000090
016 KKK Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000110
014 MMM Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000130
012 OOO Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000250
010 QQQ Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000270
008 SSS Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000290
006 UUU Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000310
004 WWW Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000330
002 YYY Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000350
026 000 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000230
028 111 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000220
029 222 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000210
030 333 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000200
031 444 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000190
032 555 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000180
033 666 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000170
034 777 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000160
035 888 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000150
036 999 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000140

Data, Sorted "Case Insensitive" File using EBCDIC Collating Sequence
(Next) (Previous) (Table-of-Contents)

The following is an example of the sequential file (JCLSCAN5.DAT) created as a result of using an EBCDIC collating sequence with the ALTSEQ function and a table that provides for case insensitivity(notice the lower case letters and upper case letters are grouped together followed by the numbers) . The sorting is done on positions 5-7. This is the collating sequence generally preferred by human beings.

....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
026 AAA Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000010
025 bbb Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000020
024 CCC Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000030
023 ddd Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000040
022 EEE Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000050
021 fff Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000060
020 GGG Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000070
019 hhh Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000080
018 III Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000090
017 jjj Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000100
016 KKK Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000110
015 lll Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000120
014 MMM Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000130
013 nnn Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000240
012 OOO Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000250
011 ppp Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000260
010 QQQ Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000270
009 rrr Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000280
008 SSS Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000290
007 ttt Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000300
006 UUU Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000310
005 vvv Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000320
004 WWW Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000330
003 xxx Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000340
002 YYY Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000350
001 zzz Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000360
026 000 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000230
028 111 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000220
029 222 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000210
030 333 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000200
031 444 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000190
032 555 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000180
033 666 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000170
034 777 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000160
035 888 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000150
036 999 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000140

Sort for EBCDIC Environment with EBCDIC Sequencing
(Next) (Previous) (Table-of-Contents)

This job describes and demonstrates the differences in the collating sequences for EBCDIC and ASCII. The last job step identifies a coding technique that will work in an EBCDIC environment but will need to be changed for an ASCII environment.

Job Overview for EBCDIC Environment
(Next) (Previous) (Table-of-Contents)

The following is a block diagram of the Job Step Logic Flow for JCLSCNJ1.

             
JCLSCNJ1
jcl
The JCL or CMD member for running the application
   
BLOWAWAY
IEFBR14
Delete previously created output files
   
SYSUT1
instream
 
 
STEP0010
IEBGENER
 
 
JCLSCAN1
rseq
Create and populate a sequential file
   
JCLSCAN1
rseq
   
   
STEP0020
SORT
 
 
JCLSCAN2
rseq
Use the SORT utility program to copy a file.
Instream Specifications, will not sort the file.
   
   
SYSIN
   
   
   
   
JCLSCAN2
rseq
   
   
STEP0030
SORT
 
 
JCLSCAN3
rseq
SORT a file, positions 1-3.
Instream Specifications
   
   
SYSIN
   
   
   
   
JCLSCAN1
rseq
   
   
STEP0040
SORT
 
 
JCLSCAN4
rseq
SORT a file, positions 5-7.
Instream Specifications
   
   
SYSIN
   
   
   
   
JCLSCAN1
rseq
   
   
STEP0050
SORT
 
 
JCLSCAN5
rseq
Case Insensitive SORT of a file.
Instream Specifications with ALTSEQ
   
   
SYSIN
   
   
   
   
EOJ
End-Of-Job
 
Job Step Logic Flow for JCLSCNJ1 with EBCDIC and ASCII Considerations

JCL Member for EBCDIC Environment
(Next) (Previous) (Table-of-Contents)

The following is the JCL Member (JCLSCNJ1.JCL) that will execute on a Mainframe System with ZOS or a Linux, UNIX or Windows System with Micro Focus Server/Studio. Notice the TYPRUN=SCAN parameter on the possible JOB card continuation is a comment and there is no comma in the last position of the actual JOB statement to indicate a continuation.

Notice STEP0050 contains a table for altering (ALTSEQ) the sorting sequence. This will create an output file using a sort that is insensitive to upper and lower case. Since the alternate sequencing definitions are coded at the binary level this step will only work correctly with an EBCDIC encoded data file.

The JOB and DD statements will need to be modified for different mainframe environments.

//JCLSCNJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//*             TYPRUN=SCAN
//* *******************************************************************
//*        This program is provided by: SimoTime Enterprises          *
//*           (C) Copyright 1987-2012 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Demonstrate the use of IEBGENER, SORT and TYPRUN=SCAN.
//* Author - SimoTime Enterprises
//* Date   - January 24, 1996
//*
//* This JCL member will show basic functions of JCL.
//*
//* STEP0010 uses the IEBGENER utility program to create a file.
//* STEP0020 uses the SORT utility to copy the file.
//* STEP0030 uses the SORT utility to sort the file on positions 1-3.
//* STEP0040 uses the SORT utility to sort the file on positions 5-7.
//* STEP0050 uses the SORT utility to sort the file on positions 5-7.
//*          This step uses an alternate collating table to sort with
//*          case insensitivity.
//*
//* CAUTION! Since the ALTSEQ is defined at the binary (or hexadecimal)
//*          level this step will only work for EBCDIC-encoded files.
//*
//* *******************************************************************
//* This step does the housekeeping to delete files created by a
//* previous run of this job.
//*
//BLOWAWAY EXEC PGM=IEFBR14,COND=(0,LT)
//DD1      DD  DSN=SIMOTIME.DATA.JCLSCAN1,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD2      DD  DSN=SIMOTIME.DATA.JCLSCAN2,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD3      DD  DSN=SIMOTIME.DATA.JCLSCAN3,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD4      DD  DSN=SIMOTIME.DATA.JCLSCAN4,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD5      DD  DSN=SIMOTIME.DATA.JCLSCAN5,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//*
//* *******************************************************************
//* This step uses IEBGENER to copy a sequential file. SYSIN is DD *
//* with thirty-six (36) records.
//*
//STEP0010 EXEC PGM=IEBGENER,COND=(0,LT)
//SYSPRINT DD  SYSOUT=*
//*.:....1....:....2....:....3....:....4....:....5....:....6....:....7. ..:....8
//SYSUT1   DD  *
026 AAA Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000010
025 bbb Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000020
024 CCC Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000030
023 ddd Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000040
022 EEE Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000050
021 fff Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000060
020 GGG Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000070
019 hhh Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000080
018 III Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000090
017 jjj Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000100
016 KKK Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000110
015 lll Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000120
014 MMM Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000130
036 999 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000140
035 888 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000150
034 777 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000160
033 666 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000170
032 555 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000180
031 444 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000190
030 333 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000200
029 222 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000210
028 111 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000220
026 000 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000230
013 nnn Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000240
012 OOO Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000250
011 ppp Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000260
010 QQQ Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000270
009 rrr Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000280
008 SSS Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000290
007 ttt Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000300
006 UUU Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000310
005 vvv Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000320
004 WWW Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000330
003 xxx Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000340
002 YYY Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000350
001 zzz Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000360
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//*
//* *******************************************************************
//* This step uses SORT to copy a sequential file. SYSIN is DD *
//* with inline control specifications.
//*
//STEP0020 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN2,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT FIELDS=COPY
/*
//*
//* *******************************************************************
//* This step uses the sort utility to sort the file created in a
//* previous step. SYSIN is DD * with inline control specifications.
//*
//STEP0030 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN2,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN3,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT  FIELDS=(1,3,CH,A)
 END
/*
//*
//* *******************************************************************
//* This step uses the sort utility to sort on the secondary field in
//* positions 5-7. This shows the collating sequence for upper and
//* lower case letters and mixed alphameric fields.
//*
//STEP0040 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN4,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT  FIELDS=(5,3,CH,A)
/*
//*
//* *******************************************************************
//* This step uses the sort utility to sort on the secondary field in
//* positions 5-7. This shows the affect of using an alternate
//* sequencing table for upper-lower case letters and mixed alpha-
//* numeric fields. The result is a case insensitive sorting sequence.
//* Note, the ALTSEQ is for an EBCDIC-encoded environment.
//*
//STEP0050 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN5,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT  FIELDS=(5,3,AQ,A)
 ALTSEQ CODE=(81C1,82C2,83C3,84C4,85C5,86C6,87C7,88C8,89C9,
              91D1,92D2,93D3,94D4,95D5,96D6,97D7,98D8,99D9,
              A2E2,A3E3,A4E4,A5E5,A6E6,A7E7,A8E8,A9E9)
/*
//*

The JCL Member for Syntax Checking
(Next) (Previous) (Table-of-Contents)

The following is the mainframe JCL (JCLSCNJ2.JCL) required to scan but not execute the process defined by the JCL member. Notice the TYPRUN=SCAN parameter on the JOB continuation statement and the comma in the last position of the JOB card to indicate a continuation.

Note: The JOB statement will need to be modified for different mainframe environments.

//JCLSCNJ2 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1,
//             TYPRUN=SCAN
//* *******************************************************************
//*        This program is provided by: SimoTime Enterprises          *
//*           (C) Copyright 1987-2012 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Demonstrate the use of TYPRUN=SCAN on the JOB statement.
//* Author - SimoTime Enterprises
//* Date   - January 24, 1996
//*
//* This JCL member will show basic functions of JCL.
//*
//* JCLSCNJ2 has the TYPRUN=SCAN on the JOB statement and simply scans
//*          the JCL for proper syntax. It does not execute. The
//*          TYPRUN=SCAN is supported on the mainframe and with
//*          Micro Focus MFE and ES/MTO Batch Facility.
//*
//* *******************************************************************
//* This step does the housekeeping to delete files created by a
//* previous run of this job.
//*
//         SET MYDSN=SIMOTIME.DATA.MYDSNDD6
//*
//BLOWAWAY EXEC PGM=IEFBR14,COND=(0,LT)
//DD1      DD  DSN=SIMOTIME.DATA.JCLSCAN1,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(DSORG=PS,RECFM=FB,LRECL=80)
//DD2      DD  DSN=SIMOTIME.DATA.JCLSCAN2,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(DSORG=PS,RECFM=FB,LRECL=80)
//DD3      DD  DSN=SIMOTIME.DATA.JCLSCAN3,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(DSORG=PS,RECFM=FB,LRECL=80)
//DD4      DD  DSN=SIMOTIME.DATA.JCLSCAN4,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(DSORG=PS,RECFM=FB,LRECL=80)
//DD5      DD  DSN=SIMOTIME.DATA.JCLSCAN5,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(DSORG=PS,RECFM=FB,LRECL=80)
//DD6      DD  DSN=&MYDSN,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(DSORG=PS,RECFM=FB,LRECL=80)
//*
//* *******************************************************************
//* This step has a syntax error to see if the TYPRUN=SCAN will catch
//* the error.
//*
//ALOCSTEP EXEC PGM=IEFBR14
//MYDSNDD6 DD  DSN=&MYDSN,DISP=(NEW,CATLG,CATLG),
//             UNIT=SYSDA,SPACE=(TRK,0),
//             DCB=(DSORG=PS,RECFM=FB,LRECL=80)
//*
//* *******************************************************************
//* This step has a syntax error to see if the TYPRUN=SCAN will catch
//* the error.
//*
//DUMBSTEP EXEC PGM=IEFBR14
//DUMBFILE DD  DSN=SIMOTIME.DATA.DUMBFILE,DISP=(MOD,DELETE,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,0),
//             DCB=(DSORG=PS,RECFM=YUK,LRECL=80)
//*

Sort for ASCII Environment with ASCII Sequencing
(Next) (Previous) (Table-of-Contents)

The following is the mainframe JCL (JCLSCNJ3.JCL) required to execute the process defined by the JCL member. Notice the TYPRUN=SCAN parameter on the JOB card continuation is a comment and there is no comma in the last position of the JOB statement to indicate a continuation.

Notice STEP0050 contains a table for changing the sorting sequence. This will create an output file using a sort that is insensitive to upper and lower case. Since the table redefines the sort sequencing changes at the binary level this step will only work correctly in an ASCII encoded data file.

The JOB and DD statements will need to be modified for different mainframe environments.

//JCLSCNJ3 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//*             TYPRUN=SCAN
//* *******************************************************************
//*        This program is provided by: SimoTime Enterprises          *
//*           (C) Copyright 1987-2012 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Demonstrate the use of IEBGENER, SORT and TYPRUN=SCAN.
//* Author - SimoTime Enterprises
//* Date   - January 24, 1996
//*
//* This JCL member will show basic functions of JCL.
//*
//* STEP0010 uses the IEBGENER utility program to create a file.
//* STEP0020 uses the SORT utility to copy.
//* STEP0030 uses the SORT utility to sort the file on positions 1-3.
//* STEP0040 uses the SORT utility to sort the file on positions 5-7.
//* STEP0050 uses the SORT utility to sort the file on positions 5-7.
//*          This step uses an alternate collating table to sort with
//*          case insensitivity.
//*
//* CAUTION! Since the ALTSEQ is defined at the binary (or hexadecimal)
//*          level this step will only work for ASCII-encoded files.
//*
//* *******************************************************************
//* This step does the housekeeping to delete files created by a
//* previous run of this job.
//*
//BLOWAWAY EXEC PGM=IEFBR14,COND=(0,LT)
//DD1      DD  DSN=SIMOTIME.DATA.JCLSCAN1,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD2      DD  DSN=SIMOTIME.DATA.JCLSCAN2,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD3      DD  DSN=SIMOTIME.DATA.JCLSCAN3,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD4      DD  DSN=SIMOTIME.DATA.JCLSCAN4,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD5      DD  DSN=SIMOTIME.DATA.JCLSCAN5,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//*
//* *******************************************************************
//* This step uses IEBGENER to copy a sequential file. SYSIN is DD *
//* with thirty-six (36) records.
//*
//STEP0010 EXEC PGM=IEBGENER,COND=(0,LT)
//SYSPRINT DD  SYSOUT=*
//*.:....1....:....2....:....3....:....4....:....5....:....6....:....7. ..:....8
//SYSUT1   DD  *
003 AAA Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000010
001 bbb Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000020
002 CCC Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000030
007 ddd Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000040
006 EEE Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000050
004 fff Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000060
005 GGG Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000070
003 hhh Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000080
001 III Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000090
002 jjj Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000100
007 KKK Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000110
006 lll Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000120
004 MMM Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000130
009 999 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000140
010 888 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000150
008 777 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000160
009 666 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000170
010 555 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000180
008 444 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000190
009 333 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000200
010 222 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000210
008 111 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000220
008 000 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000230
003 nnn Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000240
001 OOO Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000250
002 ppp Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000260
007 QQQ Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000270
006 rrr Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000280
004 SSS Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000290
005 ttt Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000300
003 UUU Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000310
001 vvv Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000320
002 WWW Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000330
007 xxx Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000340
006 YYY Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000350
004 zzz Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000360
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//*
//* *******************************************************************
//* This step uses SORT to copy a sequential file. SYSIN is DD *
//* with inline control specifications.
//*
//STEP0020 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN2,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT FIELDS=COPY
/*
//*
//* *******************************************************************
//* This step uses the sort utility to sort the file created in a
//* previous step. SYSIN is DD * with inline control specifications.
//*
//STEP0030 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN2,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN3,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT  FIELDS=(1,3,CH,A)
 END
/*
//*
//* *******************************************************************
//* This step uses the sort utility to sort on the secondary field in
//* positions 5-7. This shows the collating sequence for upper and
//* lower case letters and mixed alphameric fields.
//*
//STEP0040 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN4,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT  FIELDS=(5,3,CH,A)
/*
//*
//* *******************************************************************
//* This step uses the sort utility to sort on the secondary field in
//* positions 5-7. This shows the affect of using an alternate
//* sequencing table for upper-lower case letters and mixed alpha-
//* numeric fields. The result is a case insensitive sorting sequence.
//* Note, the ALTSEQ is for an ASCII-encoded environment.
//*
//STEP0050 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN5,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT  FIELDS=(5,3,AQ,A)
 ALTSEQ CODE=(6141,6242,6343,6444,6545,6646,6747,6848,6949,
              6A4A,6B4B,6C4C,6D4D,6E4E,6F4F,7050,7151,7252,
              7353,7454,7555,7656,7757,7858,7959,7A5A)
/*
//*

Sort for ASCII Environment with EBCDIC Sequencing
(Next) (Previous) (Table-of-Contents)

The following is the mainframe JCL (JCLSCNJ4.JCL) required to execute the process defined by the JCL member. Notice the TYPRUN=SCAN parameter on the JOB card continuation is a comment and there is no comma in the last position of the JOB statement to indicate a continuation.

Notice STEP0050 contains a table for changing the sorting sequence. This will create an output file using a sort that is insensitive to upper and lower case. Since the table redefines the sort sequencing changes at the binary level this step will only work correctly in an ASCII encoded data file. Since the numbers are also changed to follow the letters (i.e. alpha-characters) this will create a file with EBCDIC sequence in an ASCII environment.

The JOB and DD statements will need to be modified for different mainframe environments.

//JCLSCNJ4 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//*             TYPRUN=SCAN
//* *******************************************************************
//*        This program is provided by: SimoTime Enterprises          *
//*           (C) Copyright 1987-2012 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Demonstrate the use of IEBGENER, SORT and TYPRUN=SCAN.
//* Author - SimoTime Enterprises
//* Date   - January 24, 1996
//*
//* This JCL member will show basic functions of JCL.
//*
//* STEP0010 uses the IEBGENER utility program to create a file.
//* STEP0020 uses the SORT utility to copy.
//* STEP0030 uses the SORT utility to sort the file on positions 1-3.
//* STEP0040 uses the SORT utility to sort the file on positions 5-7.
//* STEP0050 uses the SORT utility to sort the file on positions 5-7.
//*          This step uses an alternate collating table to sort with
//*          case insensitivity. The table will also cause the numbers
//*          to sort after the letters for the ASCII environment.
//*
//* CAUTION! Since the ALTSEQ is defined at the binary (or hexadecimal)
//*          level this step will only work for ASCII-encoded files.
//*
//* *******************************************************************
//* This step does the housekeeping to delete files created by a
//* previous run of this job.
//*
//BLOWAWAY EXEC PGM=IEFBR14,COND=(0,LT)
//DD1      DD  DSN=SIMOTIME.DATA.JCLSCAN1,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD2      DD  DSN=SIMOTIME.DATA.JCLSCAN2,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD3      DD  DSN=SIMOTIME.DATA.JCLSCAN3,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD4      DD  DSN=SIMOTIME.DATA.JCLSCAN4,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//DD5      DD  DSN=SIMOTIME.DATA.JCLSCAN5,
//             UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE,DELETE),
//             DCB=(RECFM=FB,LRECL=80)
//*
//* *******************************************************************
//* This step uses IEBGENER to copy a sequential file. SYSIN is DD *
//* with THIRTY-SIX (36) records.
//*
//STEP0010 EXEC PGM=IEBGENER,COND=(0,LT)
//SYSPRINT DD  SYSOUT=*
//*.:....1....:....2....:....3....:....4....:....5....:....6....:....7. ..:....8
//SYSUT1   DD  *
003 AAA Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000010
001 bbb Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000020
002 CCC Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000030
007 ddd Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000040
006 EEE Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000050
004 fff Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000060
005 GGG Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000070
003 hhh Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000080
001 III Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000090
002 jjj Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000100
007 KKK Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000110
006 lll Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000120
004 MMM Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000130
009 999 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000140
010 888 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000150
008 777 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000160
009 666 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000170
010 555 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000180
008 444 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000190
009 333 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000200
010 222 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000210
008 111 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000220
008 000 Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000230
003 nnn Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000240
001 OOO Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000250
002 ppp Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000260
007 QQQ Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000270
006 rrr Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000280
004 SSS Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000290
005 ttt Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000300
003 UUU Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000310
001 vvv Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000320
002 WWW Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000330
007 xxx Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000340
006 YYY Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000350
004 zzz Bytes 1-3 are primary, Bytes 5-7 are secondary                  00000360
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//*
//* *******************************************************************
//* This step uses SORT to copy a sequential file. SYSIN is DD *
//* with inline control specifications.
//*
//STEP0020 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN2,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT FIELDS=COPY
/*
//*
//* *******************************************************************
//* This step uses the sort utility to sort the file created in a
//* previous step. SYSIN is DD * with inline control specifications.
//*
//STEP0030 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN2,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN3,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT  FIELDS=(1,3,CH,A)
 END
/*
//*
//* *******************************************************************
//* This step uses the sort utility to sort on the secondary field in
//* positions 5-7. This shows the collating sequence for upper and
//* lower case letters and mixed alphameric fields.
//*
//STEP0040 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN4,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT  FIELDS=(5,3,CH,A)
/*
//*
//* *******************************************************************
//* This step uses the sort utility to sort on the secondary field in
//* positions 5-7. This shows the affect of using an alternate
//* sequencing table for upper-lower case letters and mixed alpha-
//* numeric fields. The result is a case insensitive sorting sequence
//* with numeric values being sorted after alphabetic values.
//* Note, the ALTSEQ is for an ASCII-encoded environment.
//*
//STEP0050 EXEC PGM=SORT
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=SIMOTIME.DATA.JCLSCAN1,DISP=SHR
//SORTOUT  DD  DSN=SIMOTIME.DATA.JCLSCAN5,DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
 SORT  FIELDS=(5,3,AQ,A)
 ALTSEQ CODE=(6141,6242,6343,6444,6545,6646,6747,6848,6949,
              6A4A,6B4B,6C4C,6D4D,6E4E,6F4F,7050,7151,7252,
              7353,7454,7555,7656,7757,7858,7959,7A5A,
              30F0,31F1,32F2,33F3,34F4,35F5,36F6,37F7,38F8,39F9)
/*
//*

Summary
(Next) (Previous) (Table-of-Contents)

The purpose of this document is to assist 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 document and the links to other documents are intended to provide a choice of alternatives.

Software Agreement and Disclaimer
(Next) (Previous) (Table-of-Contents)

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Enterprises. 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 Enterprises.

SimoTime Enterprises 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 Enterprises 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.

Downloads and Links to Similar Pages
(Next) (Previous) (Table-of-Contents)

This section includes links to documents with additional information that is beyond the scope and purpose of this document. The first sub-section requires an internet connection, the second sub-section references locally available documents.

Downloads and Links, Internet Access Required
(Next) (Previous) (Table-of-Contents)

The following links will require an internet connect.

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.

Explore The JCL Connection in the SimoTime Library for more examples of JCL coding techniques and batch utility programs.

Explore The COBOL Connection in the SimoTime Library for more examples of COBOL programming techniques and sample code.

Explore the non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets.

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.

Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and QSAM files.

Explore The Micro Focus Web Site for more information about products and services available from Micro Focus.

Note: You must be attached to the Internet to download a Z-Pack or view the list.

Downloads and Links, Local Access
(Next) (Previous) (Table-of-Contents)

The following links may be accessible without an internet connection.

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

This suite of programs and documentation will describe and demonstrate the data set concatenation function provided with JCL, Utility Programs and COBOL. It is possible to process more than one data set as a single data set by concatenating the DD statements.

Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and QSAM files.

Glossary of Terms
(Next) (Previous) (Table-of-Contents)

Check out  The SimoTime Glossary  for a list of terms and definitions used in the documents provided by SimoTime.

Comments, Suggestions or Feedback
(Next) (Previous) (Table-of-Contents)

This document was created and is maintained by SimoTime Enterprises.

If you have any questions, suggestions, comments or feedback please call or send an e-mail to: helpdesk@simotime.com

We appreciate hearing from you.

Company Overview
(Next) (Previous) (Table-of-Contents)

Founded in 1987, SimoTime Enterprises 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. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. 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.

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
JCL Basic Functions, Syntax Checking and Execution with SORT Examples
Copyright © 1987-2012 SimoTime Enterprises  All Rights Reserved
When technology complements business
http://www.simotime.com