View previous topic :: View next topic |
Author |
Message |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Thu Dec 17, 2009 7:46 pm Post subject: Insert blank line on key break |
|
|
Is there a utility that will insert a blank line in a file whenever there is a break on a 'key field? Thanks for any help.
Example:
Code: | IN:
11111 SMITH
11111 SMITH
22222 JONES
22222 JONES
22222 JONES
33333 BROWN
33333 BROWN
33333 BROWN
OUT:
11111 SMITH
11111 SMITH
22222 JONES
22222 JONES
22222 JONES
33333 BROWN
33333 BROWN
33333 BROWN
|
|
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Dec 18, 2009 10:36 am Post subject: |
|
|
Here's a DFSORT job that will do what you asked for. I assumed the key is in positions 1-15 and the records are already in sorted order by the key as shown in your example.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN01 DD *
11111 SMITH
11111 SMITH
22222 JONES
22222 JONES
22222 JONES
33333 BROWN
33333 BROWN
33333 BROWN
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS
MERGE FIELDS=(1,15,CH,A)
OUTFIL REMOVECC,
SECTIONS=(1,10,SKIP=L)
/*
|
_________________ 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 |
|
 |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Fri Dec 18, 2009 11:26 am Post subject: |
|
|
Thanks, Frank...
We have SYNCSORT FOR Z/OS 1.3.2.1N
It didn't work, but that's apparently why .... |
|
Back to top |
|
 |
Brian Wood Beginner
Joined: 14 Jan 2009 Posts: 37 Topics: 0 Location: USA
|
Posted: Fri Dec 18, 2009 1:56 pm Post subject: |
|
|
tcurrrier:
Starting with the very helpful coding example offered by Frank, I was able to get the expected results using SyncSort for z/OS 1.3.2.1 by removing the 'REMOVECC' parameter from the OUTFIL statement.
Please post if you still require further assistance with this. Please feel free to email me a copy of your latest coding attempt if you are still having difficulties. _________________ Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com |
|
Back to top |
|
 |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Fri Dec 18, 2009 4:41 pm Post subject: |
|
|
Brian,
Yes, that worked... Only problem is that I had 'FB' for my RECFM, but
it apparently is looking for 'FBA'
Code: | WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 27920 |
Just out of curiosity, what does 'SECTIONS=(1,10' do ?
Thanks again, Frank & Brian... |
|
Back to top |
|
 |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Fri Dec 18, 2009 4:54 pm Post subject: |
|
|
The only problem with using FBA is that I am getting a carriage control byte at the beginning:
Code: | D - Edit - H2501S.T.TC.INSBLANK
===>
----+----1----+----2----+----3
*****************************
111111 SMITH
11111 SMITH
22222 JONES
22222 JONES
22222 JONES
33333 BROWN
33333 BROWN
33333 BROWN
***************************** |
I can probably live with it, but if you have
any ideas, would appreciate it....
Thanks. |
|
Back to top |
|
 |
Brian Wood Beginner
Joined: 14 Jan 2009 Posts: 37 Topics: 0 Location: USA
|
Posted: Fri Dec 18, 2009 5:06 pm Post subject: |
|
|
tcurrier:
Thanks for the update. I try not to hard-code the DCB in my JCL so I automatically got FBA. The 'A' refers to ANSI control character, which controls things like printer line feeds. By removing REMOVECC, you got FBA instead instead of FB.
'SECTIONS=(1,10' identifies the control field that determines what is called a "section break". Every time a change occurs in the data in that field, a new "break" occurs (see page 2.104 through 2.110 in the SyncSort 1.3 Programmer's Guide).
Please let me know if I may be of any further assistance. _________________ Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com |
|
Back to top |
|
 |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Fri Dec 18, 2009 7:07 pm Post subject: |
|
|
OK, thanks... I'll try to find a hard or soft copy of the Syncsort programmer's guide.....
In the meantime, just one more hint, please.... If I want to comment
out a control card in Syncsort, how do I do that ? |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Sat Dec 19, 2009 8:41 pm Post subject: |
|
|
Note: I used REMOVECC specifically to avoid getting FBA or the carriage control character which I assumed (from long experience) wasn't wanted in this case. _________________ 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 |
|
 |
Brian Wood Beginner
Joined: 14 Jan 2009 Posts: 37 Topics: 0 Location: USA
|
Posted: Mon Dec 21, 2009 1:39 pm Post subject: |
|
|
tcurrier:
To comment out a control statement using SyncSort, place an asterisk (*) in column 1. _________________ Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com |
|
Back to top |
|
 |
|
|