|
|
| Author |
Message |
muralialla
New User
Joined: 03 Jan 2007 Posts: 11 Location: Chennai
|
|
|
|
HI...
I have a requirement, i need to SORT the input file...but only the detail records...my file format is like this...
Hxxxxxxx
Dxxxxxxxxxxxxxxxxxxxxxxxxx
Dxxxxxxxxxxxxxxxxxxxxxxxxx
Dxxxxxxxxxxxxxxxxxxxxxxxxx
Txxxxx
The output file should have Header first, followed by all sorted detail records and then Trailer.....
any suggestions pls.... |
|
| Back to top |
|
 |
References
|
|
 |
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1253 Location: Chennai - India
|
|
| Back to top |
|
 |
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1253 Location: Chennai - India
|
|
|
|
murali,
Also give us the details of the key fields and all if you need a working JCl for your requirement. |
|
| Back to top |
|
 |
muralialla
New User
Joined: 03 Jan 2007 Posts: 11 Location: Chennai
|
|
|
|
Aaru....
Thanks for your reply....
my input file is a VB, LRECL=2082
Sort field for detail record (16,14,CH,A)
I tried with the this, i am getting error saying "OUTREC - SHORT RECORD"
output should be a VB of length 2082.
can you help me... |
|
| Back to top |
|
 |
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1024 Location: Bangalore,India
|
|
|
|
Hi murali,
Can u provide ur sort card? |
|
| Back to top |
|
 |
muralialla
New User
Joined: 03 Jan 2007 Posts: 11 Location: Chennai
|
|
|
|
INREC IFTHEN=(WHEN=(01,01,CH,EQ,C'H'),OVERLAY=(2083:C'1')),
IFTHEN=(WHEN=(01,01,CH,EQ,C'D'),OVERLAY=(2083:C'5')),
IFTHEN=(WHEN=(01,01,CH,EQ,C'T'),OVERLAY=(2083:C'9'))
SORT FIELDS=(2083,01,CH,A,
16,14,CH,A)
OUTREC FIELDS=(1,2082) |
|
| Back to top |
|
 |
krisprems
Senior Member
Joined: 27 Nov 2006 Posts: 629 Location: India
|
|
|
|
muralialla
What is the i/p and o/p RECFM and LRECL? |
|
| Back to top |
|
 |
krisprems
Senior Member
Joined: 27 Nov 2006 Posts: 629 Location: India
|
|
|
|
| Sorry i missed your previous post which says the i/p & o/p details |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4682 Location: San Jose, CA
|
|
|
|
Murali,
Here's a DFSORT job that will do what you asked for. I assumed when you said the key started in position 16, you were not counting the RDW, so it really starts in position 20 (16+4).
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB)
//SORTOUT DD DSN=... output file (VB)
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:C'1',6:5)),
IFTHEN=(WHEN=(6,1,CH,EQ,C'H'),OVERLAY=(5:C'0')),
IFTHEN=(WHEN=(6,1,CH,EQ,C'T'),OVERLAY=(5:C'9'))
SORT FIELDS=(5,1,CH,A,21,14,CH,A)
OUTREC BUILD=(1,4,5:6)
/*
|
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4682 Location: San Jose, CA
|
|
|
|
With the new DATASORT operator of DFSORT's ICETOOL, available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can do this kind of thing quite easily like this:
| Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (VB)
//OUT DD DSN=... output file (VB)
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(20,14,CH,A)
/*
|
For complete details on the new DATASORT function and the other new functions available with PTF UK90013, see:
www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/ |
|
| Back to top |
|
 |
|
|
|