View previous topic :: View next topic
|
Author |
Message |
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
Hi all,
we have a requirement like I need to sort a file which will contain as below
input file:-
00001817092007ARZLM4000012007260013236 000000
000001000001000001000001400001NNNNNNDN0006010730001239109000103
000002000001000001000001400001NNNNNNDN0006010730001239109000103
00001217092007ARZLM4001012007260013416 000000
000001000001000001000001400101NNNNNNDN0006010731001243703000101000
000002000002000001000002400101NNNNNNEN0006010731001085005000101000
000003000003000001000003400101YNYYNNGX0006010731001246607000101000
000004000004000001000003400101YNYYNNGX0006010731001246706000101000
in the above input file we have 2 header records
My requirement is I need to stick the header records as they are but only detail records need to be sorted ...could any one give me a good solution
Please dont give a solution using ICETOOL...
Please help using sort only
thanks
ajay |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Ajay,
How do you recognize the header record?
Quote: |
Please dont give a solution using ICETOOL... |
Whats wrong with the ICETOOL? Its also a DFSORT production (extension of dfsort). |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
This topic has been debated to death....
( search the forum for solution samples )
Anyway steps to be taken
- determine the offset/position an the length of the key for the records You want to exclude
( remember to add 4 in case of variable length records )
- write the sort statements adding the OMIT statements
(there are gazillions samples on the forum)
- read as pointed out by Frank sort tips and tricks
regards
e.s |
|
Back to top |
|
|
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
Just by space at loction 47 we need to recognize as a header record |
|
Back to top |
|
|
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
could any give me the sample JCL structure please instead of using words which does not help |
|
Back to top |
|
|
Rambhupal.chaudari
New User
Joined: 30 Mar 2007 Posts: 25 Location: Hyderabad
|
|
|
|
Hi ajay,
I have one doubt, are there only 2 header records in ur input file and remaining are detail records. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
could any give me the sample JCL structure please instead of using words which does not help |
/rudeness on
Why don't You show that You tried instead of asking somebody else to do Your work ??
/rudeness off
regards
e.s |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Ajay,
Use this JCL for your requirement.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
00001817092007ARZLM4000012007260013236 000000
000001000001000001000001400001NNNNNNDN0006010730001239109000103
000002000001000001000001400001NNNNNNDN0006010730001239109000103
00001217092007ARZLM4001012007260013416 000000
000001000001000001000001400101NNNNNNDN0006010731001243703000101000
000002000002000001000002400101NNNNNNEN0006010731001085005000101000
000003000003000001000003400101YNYYNNGX0006010731001246607000101000
000004000004000001000003400101YNYYNNGX0006010731001246706000101000
/*
//SORTOUT DD DSN=HLQ.HTEY,DISP=(,CATLG,CATLG)
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(71:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(47,1,CH,EQ,C' '),
OVERLAY=(71:SEQNUM,8,ZD,79:C'A')),
IFTHEN=(WHEN=(47,1,CH,NE,C' '),
OVERLAY=(79:C'B',80:SEQNUM,8,ZD,
71:71,8,ZD,SUB,80,8,ZD,M11,LENGTH=8))
SORT FIELDS=(71,9,CH,A,1,66,CH,A)
OUTREC FIELDS=(1,70)
/* |
I have sorted the detailed records starting from 1 till 66. Please code according to your requirements. The Input data is already in the sorted order. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Ajay,
Quote: |
instead of using words which does not help |
Please remeber we are here to assist you NOT to do your (complete) work. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Quote: |
instead of using words which does not help |
Definitely words would have been of great help had you followed that. Yes, as said this has been debated before and you could have searched the forum.
Moreover, Your O/P din't have all the details we were looking for (Sorting field positions etc) . |
|
Back to top |
|
|
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
ok cool |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
ajay,
Did that sort card work? Else, post your queries here. |
|
Back to top |
|
|
|