Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Write a blank output record at a change of key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
NeilDev

New User


Joined: 20 Jan 2010
Posts: 5
Location: UK

PostPosted: Fri Feb 05, 2010 2:06 pm    Post subject: Write a blank output record at a change of key
Reply with quote

Hi,

I have the following input data:

James Smith 111111
Neil Smith 111111
Nigel Jonesa 222222
Nigel Jonesa 222222
Nigel Jonesb 222222
Richard Jones 333333

and would like to output a blank line at a change of key, so the data looks like this:

James Smith 111111
Neil Smith 111111

Nigel Jonesa 222222
Nigel Jonesa 222222
Nigel Jonesb 222222

Richard Jones 333333

Can anyone help please?
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Feb 05, 2010 2:39 pm    Post subject:
Reply with quote

Below SORT step will give you required result...
Code:

//STEP10   EXEC PGM=SORT                         
//SORTIN       DD *                             
JAMES SMITH   111111                             
NEIL SMITH    111111                             
NIGEL JONESA  222222                             
NIGEL JONESA  222222                             
NIGEL JONESB  222222                             
RICHARD JONES 333333                             
/*                                               
//SORTOUT DD SYSOUT=*                           
//SYSOUT  DD SYSOUT=*                           
//SYSIN    DD  *                                 
  SORT FIELDS=(15,6,ZD,A)                       
  OUTFIL REMOVECC,SECTIONS=(15,6,TRAILER3=(80:X))
/*                                               
Back to top
View user's profile Send private message
NeilDev

New User


Joined: 20 Jan 2010
Posts: 5
Location: UK

PostPosted: Fri Feb 05, 2010 2:50 pm    Post subject: Reply to: Write a blank output record at a change of key
Reply with quote

Thankyou very much.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Feb 05, 2010 11:26 pm    Post subject:
Reply with quote

Here's a more general way to do this that doesn't require knowing the LRECL of the records:

Code:

  SORT FIELDS=(15,6,ZD,A)                     
  OUTFIL REMOVECC,SECTIONS=(15,6,SKIP=1L)     


Note that if the records are already in sorted order, it would be more efficient to use COPY rather than SORT.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us