Thread: DFSORT and ICETOOL

How do I sort a file with DFSORT? Tiny example?

Started by Sam • user3 replies170 viewsLast activity 3 weeks ago
Post #1
0 votes
Sam
Reputation
5
Posts: 28
Joined: Jul 1, 2026, 2:30 PM
Posted: Jul 25, 2026, 1:51 PM

Need to sort a FB file by account number in columns 1-8. Is this a whole COBOL program or can JCL do it?

Post #2
1 votes
Bill
Reputation
221
Posts: 41
Joined: Aug 28, 2024, 7:08 AM
Posted: Jul 25, 2026, 3:51 PM

JCL + DFSORT. Roughly:

//SORT STEP EXEC PGM=SORT
//SORTIN DD DSN=your.in,DISP=SHR
//SORTOUT DD DSN=your.out,DISP=(NEW,CATLG,DELETE)...
//SYSIN DD *
SORT FIELDS=(1,8,CH,A)
/*

Ask ops for a sample with your site's SPACE defaults filled in.

Post #3
0 votes
Jen
Reputation
287
Posts: 34
Joined: Sep 3, 2024, 11:02 AM
Posted: Jul 25, 2026, 6:51 PM

CH = character. If it is packed decimal the format code changes. Start with CH for practice files.

You must be signed in to reply to this thread