View previous topic :: View next topic |
Author |
Message |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Oct 10, 2005 8:46 am Post subject: Sort records in between header and trailer... |
|
|
Hi all,
I need to Sort only records in between header(MM) and trailer(MM)...
and write to output file with header and trailer. Any help is appreciated.
Code: |
//DDDDDS2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD DSN=AK.JCL(DDCNT),DISP=SHR
//SORTIN DD DSN=AK.FILEI,DISP=SHR
//SORTOUT DD DSN=AK.SORT.FILEO(+1),
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(50,10),RLSE),
// UNIT=SYSDA,
// DCB=(LRECL=100,DSORG=PS,RECFM=FB) |
DDCNT
Code: |
SORT FIELDS=(16,13,CH,A)
SUM FIELDS=NONE
|
AK.FILEI
Quote: |
MM9999900510100823DDDDD FFFFF 003200527520
AAR FIRST C 1134341444441 XXXXXXXXX
ATX SECOND 7777777770111 XXXXXXXXX
ATX THIRD L 6297132201111 XXXXXXXXX
MM9999900510100823DDDDD FFFFF 003 |
|
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Aug 11, 2008 6:19 pm Post subject: |
|
|
With z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can now use the new DATASORT operator of DFSORT's ICETOOL to easily keep headers, trailers or headers and trailers in place while you sort the data records between them. For complete details on DATASORT, 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 |
|
 |
Sqlcode Intermediate
Joined: 15 Dec 2006 Posts: 157 Topics: 38
|
Posted: Mon Sep 08, 2008 10:17 am Post subject: |
|
|
Frank,
We have just got new PTF installed last weekend.
While I was trying couple of JCLs I got this strange error. I was trying to solve above mentioned problem with DATASORT facility.
Below is the JCL which I used.
Code: | //S1 EXEC PGM=ICETOOL
//IN DD *
MM9999900510100823DDDDD FFFFF 003200527520
AAR FIRST C 1134341444441 XXXXXXXXX
ATX SECOND 7777777770111 XXXXXXXXX
ATX THIRD L 6297132201111 XXXXXXXXX
MM9999900510100823DDDDD FFFFF 003
//OUT DD SYSOUT=*
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
//CTL1CNTL DD
SORT FIELDS=COPY
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=* |
I even tried, OPTION COPY instead of SORT FILEDS=COPY but none of them worked.
I got below mentioned error Message.
Code: |
ICE632I 0 SOURCE FOR ICETOOL STATEMENTS: TOOLIN
ICE630I 0 MODE IN EFFECT: STOP
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
ICE654A 0 SORT FUNCTION IS REQUIRED FOR DATASORT OPERATION
ICE602I 0 OPERATION RETURN CODE: 12
ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE: 12
|
When looked at Error Message description it says :
Code: |
ICE654A SORT FUNCTION IS REQUIRED FOR DATASORT OPERATION
Explanation: Critical. A DFSORT SORT statement was not found for this DATASORT operator, but you must
supply a SORT statement with DATASORT.
System Action: This operation is terminated.
Programmer Response: Specify a SORT statement in the xxxxCNTL data set corresponding to the USING(xxxx)
operand for this DATASORT operator. Ensure that the SORT statement is not overridden by an OPTION COPY
statement.
|
Could you please guide me if I am doing something wrong? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Mon Sep 08, 2008 10:21 am Post subject: |
|
|
Rajen,
The message ICE654A is self explanatory. You need to have a sort statement for DATASORT function. You have SORT FIELDS=COPY which is not valid for datasort. What fields are you trying sort in the detail records? If your intention is to drop header/trailer records then use the function SUBSET
Quote: |
ICE654A SORT FUNCTION IS REQUIRED FOR DATASORT OPERATION
Explanation: Critical. A DFSORT SORT statement was not found for this DATASORT operator, but you must
supply a SORT statement with DATASORT.
System Action: This operation is terminated.
Programmer Response: Specify a SORT statement in the xxxxCNTL data set corresponding to the USING(xxxx)
operand for this DATASORT operator. Ensure that the SORT statement is not overridden by an OPTION COPY statement. |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Sqlcode Intermediate
Joined: 15 Dec 2006 Posts: 157 Topics: 38
|
Posted: Mon Sep 08, 2008 10:35 am Post subject: |
|
|
Kolusu,
I am trying to SORT based on first 3 bytes but nothing seems to work to I tried SORT FIELDS=COPY.
Below is the original JCL and respective error message.
Code: | //S1 EXEC PGM=ICETOOL
//IN DD *
MM9999900510100823DDDDD FFFFF 003200527520
AAR FIRST C 1134341444441 XXXXXXXXX
ATX SECOND 7777777770111 XXXXXXXXX
ATX THIRD L 6297132201111 XXXXXXXXX
MM9999900510100823DDDDD FFFFF 003
//OUT DD SYSOUT=*
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
//CTL1CNTL DD
SORT FIELDS=(1,3,CH,A)
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=* |
Code: | ICE632I 0 SOURCE FOR ICETOOL STATEMENTS: TOOLIN
ICE630I 0 MODE IN EFFECT: STOP
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
ICE654A 0 SORT FUNCTION IS REQUIRED FOR DATASORT OPERATION
ICE602I 0 OPERATION RETURN CODE: 12 |
ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE: 12
What surprises me is the error message that says SORT FUNCTION IS REQUIRED FOR DATASORT. I was assuming that it would look for keyword SORT in the control card.
Now, Here I am trying to SORT based on first 3 bytes, which gave me same error.
I am afraid now that I may be doing something wrong from basic . |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Mon Sep 08, 2008 10:43 am Post subject: |
|
|
rajen wrote: | I am afraid now that I may be doing something wrong from basic |
Rajen,
Your SORT Control cards start in POS 1 which is NOT valid. Toolin statements can start from pos 1 but not the XXXXCNTL cards.
Code your sort fields statement from pos 2 and the job will run fine. And the input is already sorted on the first 3 bytes. so you will see the same as input. If you want to see how the data is sorted then try this job
Code: |
//STEP0300 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
MM9999900510100823DDDDD FFFFF 003200527520
ATX SECOND 7777777770111 XXXXXXXXX
ATX THIRD L 6297132201111 XXXXXXXXX
AAR FIRST C 1134341444441 XXXXXXXXX
MM9999900510100823DDDDD FFFFF 003
//OUT DD SYSOUT=*
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=(1,3,CH,A)
|
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Sqlcode Intermediate
Joined: 15 Dec 2006 Posts: 157 Topics: 38
|
Posted: Mon Sep 08, 2008 10:51 am Post subject: |
|
|
Oh..my..bad!!
After doing it many times for other DFSORT tricks, I missed that part here.
Thanks again Kolusu. |
|
Back to top |
|
 |
|
|