|
View previous topic :: View next topic
|
| Author |
Message |
anish.ibm
New User
.jpg)
Joined: 28 Jun 2007 Posts: 23 Location: Bangalore
|
|
|
|
Here is the Input:
| Code: |
----+----2----+----2----+----3----+--
***************************** Top of
1111111111111111111111100011111111111 -- Header
11111111111111111111 AAA 1111111111
11111111111111111111 AAA 1111111111
11111111111111111111 AAA 1111111111
11111111111111111111 BBB 0123111111
11111111111111111111 BBB 4563111111
11111111111111111111 BBB 7890111111
11111111111111111111 CCC 1111111111
11111111111111111111 CCC 1111111111
2222222222222222222222200022222222222 -- Header
22222222222222222222 AAA 2222222222
22222222222222222222 AAA 2222222222
22222222222222222222 AAA 2222222222
22222222222222222222 BBB 0223222222
22222222222222222222 BBB 4567222222
22222222222222222222 BBB 8902222222
22222222222222222222 CCC 2222222222
22222222222222222222 CCC 2222222222
|
Output should be
| Code: |
----+----2----+----2----+----3----+--
***************************** Top of
1111111111111111111111100011111111111 -- Header
11111111111111111111 AAA 1111111111
11111111111111111111 AAA 1111111111
11111111111111111111 AAA 1111111111
11111111111111111111 BBB 0123111111
11111111111111111111 CCC 1111111111
11111111111111111111 CCC 1111111111
2222222222222222222222200022222222222 -- Header
22222222222222222222 AAA 2222222222
22222222222222222222 AAA 2222222222
22222222222222222222 AAA 2222222222
22222222222222222222 BBB 0223222222
22222222222222222222 CCC 2222222222
22222222222222222222 CCC 2222222222
|
Here the first entry of BBB should be retained and the next 2 entries should be deleted.
Any possibilites through SORT TECH
Thank You
Anish |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8798 Location: Welsh Wales
|
|
|
|
Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.
If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.
If the messages start with ICE then your product is DFSORT. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.
If the messages start with WER or SYT then the product is SYNCSORT and should be posted in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.
Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in you site.
| Code: |
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY |
You also need to provide other details than you already have.
What is the DSORG, RECFM & LRECL of both input and output
If there are any keys located in the input file, please specify their length and format |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
anish.ibm,
The following DFSORT JCL will give you the desired results
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1111111111111111111111100011111111111 -- HEADER
11111111111111111111 AAA 1111111111
11111111111111111111 AAA 1111111111
11111111111111111111 AAA 1111111111
11111111111111111111 BBB 0123111111
11111111111111111111 BBB 4563111111
11111111111111111111 BBB 7890111111
11111111111111111111 CCC 1111111111
11111111111111111111 CCC 1111111111
2222222222222222222222200022222222222 -- HEADER
22222222222222222222 AAA 2222222222
22222222222222222222 AAA 2222222222
22222222222222222222 AAA 2222222222
22222222222222222222 BBB 0223222222
22222222222222222222 BBB 4567222222
22222222222222222222 BBB 8902222222
22222222222222222222 CCC 2222222222
22222222222222222222 CCC 2222222222
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,RESTART=(24,3)))
OUTFIL BUILD=(1,80),OMIT=(24,3,CH,EQ,C'BBB',AND,81,8,ZD,GT,1)
//* |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|