MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Temujin Beginner Joined: 19 Jun 2007 Posts: 13 Topics: 6
Posted: Wed Feb 25, 2009 9:57 am Post subject: Specific records to be sorted
I am facing a problem can anybody please look into this and help me out, I tried searching but failed to get the answer.
Below is the test data of my input file:
0000ABCDEF
ACCEPTED
11110002000ADDICT
44420002000ADDICT
22211110002000ANOWHS
44420002000ADDICT
My requirement is to have the first two records as it is (order should be preserved) and the rest of the records to be sorted
on first 3 bytes. I could achieve this in 3 steps, can anybody help me in reducing the number of steps?
The output file should look like below:
0000ABCDEF
ACCEPTED
11110002000ADDICT
22211110002000ANOWHS
44420002000ADDICT
44420002000ADDICT
Thanks,
Temu.
Back to top
Frank Yaeger Sort Forum Moderator Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Feb 25, 2009 10:28 am Post subject:
Here's a DFSORT/ICETOOL job that will do what you asked for in one pass/step.
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB)
//OUT DD DSN=... output file (FB)
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER(2) USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,3,CH,A)
/*
For complete details on the DATASORT function and the other new functions available with DFSORT PTF UK90013 (July, 2008), see:
www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/ _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
amargulies Beginner Joined: 10 Jan 2007 Posts: 123 Topics: 0
Posted: Thu Feb 26, 2009 10:18 am Post subject:
Assuming the input file is FB/80, try this alternate solution:
Code:
//S1 EXEC PGM=SORT
//SORTIN DD DSN=input.file,...
//SORTOUT DD DSN=output.file,...
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(81,8,ZD,GT,2),OVERLAY=(81:C'99999999'))
SORT FIELDS=(81,8,CH,A,1,3,CH,A)
OUTREC FIELDS=(1,80)
/*
_________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum