|
View previous topic :: View next topic
|
| Author |
Message |
autobox
New User
Joined: 19 Aug 2005 Posts: 51
|
|
|
|
Hi,
Please advise if MF SORT can do this:
Sort a PS file and then add separators between different blocks sorted. For example, the original file looks like:
| Code: |
AAAA...........
BBBB...........
AAAA...........
CCCC...........
BBBB........... |
I want the results look like (sorted by first 4 characters):
| Code: |
AAAA...........
AAAA...........
------------------- <- a separator line
BBBB...........
BBBB...........
------------------- <- a separator line
CCCC........... |
Thanks. |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| Quote: |
| Please advise if MF SORT can do this: |
Yes It can be done with DFSORT like below.
I have assumed LRECL 80
| Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
AAAA...........
BBBB...........
AAAA...........
CCCC...........
BBBB...........
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,4,CH,A)
OUTFIL REMOVECC,
SECTIONS=(1,4,TRAILER3=(80C'-'))
|
Outptu will be:
| Code: |
AAAA...........
AAAA...........
-------------------------------------------------------------------------------
BBBB...........
BBBB...........
-------------------------------------------------------------------------------
CCCC...........
-------------------------------------------------------------------------------
|
|
|
| Back to top |
|
 |
autobox
New User
Joined: 19 Aug 2005 Posts: 51
|
|
|
|
Hi Sambhaji,
Thanks for your help. I tried your control statements, and it works for the example I posted here.
Actually, the field I sorted is nearly 4000 bytes (3954 bytes exactly, the file LRECL is 4000, FB), and I need to add separator lines according to that 3954-byte-long field. I tried 'SECTIONS=(46,3954,TRAILER3=(4000C'-')) ', but it seems that did not work.
| Code: |
SORT FIELDS=(46,3954,CH,A)
OUTFIL REMOVECC,
SECTIONS=(46,3954,TRAILER3=(4000C'-'))
$
ICE223A F REPORT FIELD ERROR
ICE052I 3 END OF DFSORT |
Please advise if there's a length limitation of the 'SECTIONS=' control statement. |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
I think m can be upto 256 |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
autobox,
Use the following Control cards
| Code: |
//SYSIN DD *
SORT FIELDS=(46,3954,CH,A)
OUTFIL REMOVECC,
SECTIONS=(0046,256,SKIP=0L,
0302,256,SKIP=0L,
0558,256,SKIP=0L,
0814,256,SKIP=0L,
1070,256,SKIP=0L,
1326,256,SKIP=0L,
1582,256,SKIP=0L,
1838,256,SKIP=0L,
2094,256,SKIP=0L,
2350,256,SKIP=0L,
2606,256,SKIP=0L,
2862,256,SKIP=0L,
3118,256,SKIP=0L,
3374,256,SKIP=0L,
3630,256,SKIP=0L,
3886,115,SKIP=0L,
TRAILER3=(4000C'-'))
//* |
|
|
| Back to top |
|
 |
autobox
New User
Joined: 19 Aug 2005 Posts: 51
|
|
|
|
Hi Skolusu,
Thanks for your advise. Everything works now! |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|