MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Insert blank line on key break

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Thu Dec 17, 2009 7:46 pm    Post subject: Insert blank line on key break Reply with quote

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
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Dec 18, 2009 10:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Fri Dec 18, 2009 11:26 am    Post subject: Reply with quote

Thanks, Frank...

We have SYNCSORT FOR Z/OS 1.3.2.1N

It didn't work, but that's apparently why ....
Back to top
View user's profile Send private message
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Fri Dec 18, 2009 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Fri Dec 18, 2009 4:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Fri Dec 18, 2009 4:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Fri Dec 18, 2009 5:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Fri Dec 18, 2009 7:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Dec 19, 2009 8:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Mon Dec 21, 2009 1:39 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group