MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Anand_R Intermediate Joined: 24 Dec 2002 Posts: 189 Topics: 60
Posted: Thu Jan 23, 2003 4:56 am Post subject: Ignore first Header record while sorting..
Hi,
I have file structure as follows...
Header record
Detail 1
Detail2
The file is having sequential fixed block 80 and no duplicates
I want to sort on 10 to 15 position
Pls let me know can we do and if so .. post the jcl..
Thanks
Anand
Back to top
coolman Intermediate Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Thu Jan 23, 2003 5:55 am Post subject:
Anand,
The following DFSORT/ICETOOL job would help you. If you have Syncsort, then change pgm to SYNCTOOL.
Code:
//STEP1 EXEC PGM=ICETOOL
//IN1 DD *
HEADER
DFDFDFDFDF23345
DFDSDSFFDD23345
HJHGJJJGDE23345
FDGFDGDGDC23345
ABVCNNNFDA23345
ZSDFDFGGDB23345
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILE1 DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN1) TO(FILE1) USING(CTL1)
/*
//CTL1CNTL DD *
OMIT COND=(1,6,CH,EQ,C'HEADER')
SORT FIELDS=(10,6,CH,A)
/*
//*
Coolman
________
uhwh Last edited by coolman on Sat Feb 05, 2011 1:17 am; edited 1 time in total
Back to top
Frank Yaeger Sort Forum Moderator Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Jan 23, 2003 10:49 am Post subject:
Another way to do this with DFSORT/ICETOOL is to use SKIPREC=1 to skip the first record instead of the OMIT statement, e.g.
Code:
//CTL1CNTL DD *
OPTION SKIPREC=1
SORT FIELDS=(10,6,CH,A)
/*
If you actually want the output file to have the HEADER record followed by the rest of the sorted records, the "Sort records between a header and trailer" Smart DFSORT Trick shows how to do that with DFSORT/ICETOOL:
http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ _________________ 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 Last edited by Frank Yaeger on Thu Sep 14, 2006 4:38 pm; edited 1 time in total
Back to top
Anand_R Intermediate Joined: 24 Dec 2002 Posts: 189 Topics: 60
Posted: Mon Jan 27, 2003 6:15 am Post subject:
Hi Coolman/Frank,
Thanks for ur response..
I want the header also to be present in the output file as first record..
What paramenters I should specify..
Thx
Anand
Back to top
Anand_R Intermediate Joined: 24 Dec 2002 Posts: 189 Topics: 60
Posted: Mon Jan 27, 2003 7:03 am Post subject:
Ravi,
Logically it's good.. but what if I want to insert that header in particualr postion..
Is it possible thru the utility
Thx
Anand
Back to top
coolman Intermediate Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Mon Jan 27, 2003 8:14 am Post subject:
Anand,
The following ICETOOL job can include your header as the first record.
Code:
//STEP1 EXEC PGM=ICETOOL
//IN1 DD *
HEADER
DFDFDFDFDF23345
DFDSDSFFDD23345
HJHGJJJGDE23345
FDGFDGDGDC23345
ABVCNNNFDA23345
ZSDFDFGGDB23345
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//T3 DD SYSOUT=*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE)
//CON DD DSN=*.T1,DISP=(OLD,PASS),VOL=REF=*.T1
// DD DSN=*.T2,DISP=(OLD,PASS),VOL=REF=*.T2
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
SORT FROM(IN1) TO(T2) USING(CTL2)
COPY FROM(CON) USING(CTL3)
/*
//CTL1CNTL DD *
OPTION STOPAFT=1
/*
//CTL2CNTL DD *
OPTION SKIPREC=1
SORT FIELDS=(10,6,CH,A)
/*
//CTL3CNTL DD *
OUTFIL FNAMES=T3
/*
//
Coolman
________
marijuana pictures
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