I don't know if a bug or an enhancement.
Since I could find no GCSORT documentation excluding SYMBOLS I guess it is a bug.
SYMBOLS is not a feature of ICETOOLS - support lies within DFSORT proper.
zOS example of DFSORT using the SYMBOLS facility
~~~
//ASORTE15 JOB 'WINZOS-SORT',CLASS=A,MSGCLASS=A
//STEP01 EXEC PGM=IEFBR14
//SYSUT1 DD DSN=TESTDATA.WINZOS.SORTED.DATA,DISP=(MOD,DELETE,DELETE)
/
//STEP02 EXEC PGM=SORT
//SORTIN DD DSN=TESTDATA.ASCII.DATA,DISP=SHR
// DD DSN=TESTDATA.UNSORT.ASCII.DATA2,DISP=SHR
// DD DSN=TESTDATA.UNSORTED.ASCII.DATA,DISP=SHR
// DD DSN=TESTDATA.ASCII.DATA,DISP=SHR
//SORTOUT DD DSN=TESTDATA.WINZOS.SORTED.DATA,DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=400,RECFM=FB,BLKSIZE=0)
//SYSOUT DD SYSOUT=
//SYMNAMES DD *
ORDERNUM,1,6,CH
/
//SORTCNTL DD *
OPTION MODS E15=(TESTAE15)
SORT FIELDS=(ORDERNUM,A)
OMIT COND=(3,1,CH,EQ,C'1')
/*
//
** WINZOS JOB LOG Copyright 2010-2026 Metamorphous Company LLC **
JOB: ASORTE15 JOB NUMBER: 0036 DATE: 08/19/26 TIME: 21:39:47
1 //ASORTE15 JOB 'WINZOS-SORT',CLASS=A,MSGCLASS=A
2 //STEP01 EXEC PGM=IEFBR14
3 //SYSUT1 DD DSN=TESTDATA.WINZOS.SORTED.DATA,DISP=(MOD,DELETE,DELETE)
4 /
5 //STEP02 EXEC PGM=SORT
6 //SORTIN DD DSN=TESTDATA.ASCII.DATA,DISP=SHR
7 // DD DSN=TESTDATA.UNSORT.ASCII.DATA2,DISP=SHR
8 // DD DSN=TESTDATA.UNSORTED.ASCII.DATA,DISP=SHR
9 *** DD DSN=TESTDATA.ASCII.DATA,DISP=SHR
10 //SORTOUT DD DSN=TESTDATA.WINZOS.SORTED.DATA,DISP=(NEW,CATLG,DELETE),
11 // DCB=(LRECL=400,RECFM=FB,BLKSIZE=0)
12 //SYSOUT DD SYSOUT=
13 //SYMNAMES DD *
16 //SORTCNTL DD *
22 *** OMIT COND=(3,1,CH,EQ,C'1')
23 //
* JOB STATISTICS
21:39:47 STEP01 - STEP STARTED
TESTDATA.WINZOS.SORTED.DATA DELETED
21:39:47 STEP01 - STEP WAS EXECUTED RETURN-CODE=0000
21:39:47 STEP02 - STEP STARTED
+++ SYMBOLS
+++ ORDERNUM,1,6,CH
+++ END
+++
+++ OPTION MODS E15=(TESTAE15)
+++ SORT FIELDS=(1,6,CH,D)
+++ SORT FIELDS=(ORDERNUM,A)
+++ OMIT COND=(3,1,CH,EQ,C'1')
+++
+++ ERROR : SYNTAX ERROR, UNEXPECTED STRING, EXPECTING
+++ ERROR NEAR ELEMENT : SYMBOLS
+++ ABEND STEP ABEND SORT FAILED RETURN-CODE = 16
21:39:47 STEP02 - STEP ABENDED RETURN-CODE=0016
21:39:48 ASORTE15 (0036) ENDED WITH AN ABEND - RETURN-CODE 0016 - JOB ENDED
2 public AI(s) took a left turn halucination infering that this syntax would implement SYMBOLS support within GCSORT - AI lied :-)
SYMBOLS
ORDERNUM,1,6,CH
END
USE C:\WINZOS\DATA\SORTIN03.DAT RECORD F,00400 ORG SQ
USE C:\WINZOS\DATA\SORTIN02.DAT RECORD F,00400 ORG SQ
USE C:\WINZOS\DATA\SORTIN01.DAT RECORD F,00400 ORG SQ
GIVE C:\WINZOS\ZOSICF\S2121558.DAT RECORD F,00400 ORG SQ
OPTION MODS E15=(TESTAE15)
SORT FIELDS=(ORDERNUM,A)
OMIT COND=(3,1,CH,EQ,C'1')
~~~
GCSORT has no support to parse, or process DFSORT SYMBOLS.
It only understands numbers, lengths, data types and order (like "1,6,CH,A" in my JCL sort)
The onus of storing the SYMBOLS and then parsing and substituting the the SYMBOL tokens with numbers, lengths, data types should be that of GCSORT
I could do the substitution in WINZOS but then GCSORT users that do not use WINZOS would not have support for SYMBOLS
Agreed ?
Hi,
I've analyzed the issue regarding SYMBOLS.
Indeed, the SORT function must handle the SYMBOLS.
For GCSort, I thought I'd organize the handling this way:
1) Define an environment variable named: SYMNAMES
2) Assign the name of a file containing the symbolic variable information to this variable
Example:
SYMNAMES=..\files\symnames.txtThe file ..\files\symnames.txt will contain:
<variable name="">,value(s)</variable>
An example of the file format is as follows:
ID,1,8,ZD
Name,9,15,CH
If the first character is a ‘*’, the line indicates a comment.
During startup, if GCSort finds the SYMNAMES environment variable defined, it retrieves the file name.
If the file exists and its format conforms to the expected structure, it loads a table of symbols that
GCSort will use to replace variables with the values extracted from the file.
The substitution will occur on all lines sent to GCSort, before actual execution.
I’ll need a few days to implement the solution.
I’ll send an update as soon as I finish development and testing.
Okay?
Best regards.
Sauro
Sounds like a good plan - but I suggest to use libcob's file resolution instead of building that manually (this way DD_SYMNAMES and SYMNAMES env vars work, as well as using COB_FILE_PATH). The easiest way is possible calling into cob_open for input - and either read_next through the file (then it exists somewhere following gc rules) or don't do the symnames setup.
Last edit: Simon Sobisch 2026-08-21
Okay,
thanks for the suggestion.
The feature will be implemented using libcob.
The question is which file type to use (Line Sequential or Sequential).
If Line Sequential is used, we might run into the problem previously identified in the GCSort Take file, namely a NULL character in the file.
For now, I’ll use Line Sequential, so I’ll need to generate the SYMNAMES files with that structure (without NULL characters).
Are you planning to use the takefile for specifying the SYMBOLS ?
That actually seems as if would fit in easily - would it not ?
Are there other operands that precede the USE clause(s) ?
Please advise
Hi,
The implementation in GCSort will be the same as in DFSORT, that is, using an external file, as in JCL.
In accordance with the DFSORT standard, an environment variable named DD_SYMNAMES, dd_SYMNAMES, or SYMNAMES must be created, specifying the physical file.
According to IBM and Microfocus documentation, the dataset or file assigned to DD SYMNAMES must have a fixed-length record format (RECFM=F or RECFM=FB) and a record length of 80 bytes (LRECL=80).
I will adopt this definition in GCSort.
Example:
or with the SKIP parameter
The Microfocus Sort utility allows you to specify symbols in the TAKE file, but they must be enclosed within a block.
Example:
I think the idea of including the symbol definitions in the TAKE file is a good one.
I’ll implement this using both an environment variable with an external file and within the TAKE file itself.
Thank you.
Sauro
Last edit: Simon Sobisch 7 days ago
I understand the SYMBOLS integration.
Hey while you are in the source code can you add a counter to the audit file.
Records omitted or included.
This is what I produced from my DFSORT emulation.
Thank you for the feedback !
Bruce
Last edit: Simon Sobisch 6 days ago
I would think that the implementation would follow SYSIN
From a zOS perspective there is a SYSIN DD and a SYMNAMES DD
~~~
//STEP02 EXEC PGM=SORT
//SORTIN DD DSN=TESTDATA.UNSORTED.ASCII.DATA,DISP=SHR
// DD DSN=TESTDATA.UNSORT.ASCII.DATA2,DISP=SHR
// DD DSN=TESTDATA.ASCII.DATA,DISP=SHR
//SORTOUT DD DSN=TESTDATA.WINZOS.SORTED.DATA,DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=400,RECFM=FB,BLKSIZE=0)
//SYSOUT DD SYSOUT=*
//SYSIN DD DSN=TSUBLUH.SORTCNTL.PDSIN,DISP=SHR
//STEP02 EXEC PGM=SORT
//SORTIN DD DSN=TESTDATA.ASCII.DATA,DISP=SHR
// DD DSN=TESTDATA.UNSORT.ASCII.DATA2,DISP=SHR
// DD DSN=TESTDATA.UNSORTED.ASCII.DATA,DISP=SHR
// DD DSN=TESTDATA.ASCII.DATA,DISP=SHR
//SORTOUT DD DSN=TESTDATA.WINZOS.SORTED.DATA,DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=400,RECFM=FB,BLKSIZE=0)
//SORTCNTL DD *
OPTION MODS E15=(TESTAE15)
SORT FIELDS=(1,6,CH,A)
OMIT COND=(3,1,CH,EQ,C'1')
/
The SYSIN DD dataset name is a defacto zOS best practice
As opposed to SYSIN DD *
The SYMNAMES parameters should parallel the SYSIN paradigm
However SYMNAMES is implemented I have the need to extract it from JCL and feed GCSORT - Akin to SYSIN
Last edit: Ralph Linkletter 2026-08-21
Hi,
I've released a new version of GCSort, ver. 1.05.00, with a number of updates.
Here are the details:
Best regards.
Sauro
Can you document how it was implemented on your side please.
SYMORG or SYMNAMES ?
If in the TAKEFILE what syntax is required in supporting symbols
The new record counter is impleneted with ?
Please advise,
Thanks
Bruce
Hi,
Attached are two examples of how to use SYMNAME.
1) SYMNAMES within the TAKE file. In this case, the contents of the SYMNAMES definition are enclosed between the SYMNAMES (start) and END (end) lines. The definition of the SYMNAMES and SYMORG environment variables must be omitted.
Within the TAKE file, before defining the SORT instructions, you can insert symbols enclosed between two lines that define the start and end of the SYMNAMES definition.
Start: SYMNAMES
End: END
2) SYMNAMES defined in an external file. In this case, you must set the SYMNAMES environment variable to the pathname of the definition file. SYMORG is required only for SYMORG=SQ, and the record length is fixed at 80 characters.
The requirements for the definition are identical to those for the TAKE file.
The definition of the SYMNAMES fields is as follows:
SYMNAMES format:
In the SYMNAMES file, you can assign a descriptive name to record positions, constants, or keywords.
The asterisk (*) indicates “continue from where the previous field ended.”
I have included some additional details in the document located in gcsort/doc (GCSORT_Manual.pdf).
The new record counter dedicated to OMIT/INCLUDE is displayed only if the SORT commands contain the OMIT or INCLUDE construct and the counter takes on a value greater than zero.
Example:
==============================================================
==============================================================
first example
Hi,
Attached is a ZIP file with two examples in Windows environment.
readme.txt contains the details.
1) Example - SYMNAMES definition in the take file
gcsort TAKE take_symb.prm
2) Example - SYMNAMES definition in an external file
set SYMNAMES=fsymb.txt
gcsort TAKE take_symb_file.prm
Sauro