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 

Can DFSORT do this?

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


Joined: 23 Apr 2007
Posts: 1
Topics: 1

PostPosted: Fri May 04, 2007 3:19 pm    Post subject: Can DFSORT do this? Reply with quote

OK, I have 3 files, each has a header line, and multiple detail lines. The 3 files get merged. Here is what the merged file looks like.
Code:

00124       0000000000000620070412150000002007041214534900                     
001244801ORDORDO480112345O01010000000000000032031017200002  00000000000000001000
001244801ORDORDO480112345O01290000000000000000793084020061  00000000000000001000
001244801ORDORDO480112345O01480000000000000055568014150738  00000000000000001000
001244801ORDORDO480112345O01480000000000000050216014200672  00000000000000001000
001244801ORDORDO480112345O01140000000000000007063036011446  00000000000000001000
001244801ORDORDO480112345O01130000000000000018862096011337  00000000000000001000
00124       0000000000000620070412150000002007041214534900                     
001244802ORDORDO480112345O01010000000000000032031017200002  00000000000000001000
001244802ORDORDO480112345O01290000000000000000793084020061  00000000000000001000
001244802ORDORDO480112345O01480000000000000055568014150738  00000000000000001000
001244802ORDORDO480112345O01480000000000000050216014200672  00000000000000001000
001244802ORDORDO480112345O01140000000000000007063036011446  00000000000000001000
001244802ORDORDO480112345O01130000000000000018862096011337  00000000000000001000
00124       0000000000000620070412150000002007041214534900                     
001244803ORDORDO480112345O01010000000000000032031017200002  00000000000000001000
001244803ORDORDO480112345O01290000000000000000793084020061  00000000000000001000
001244803ORDORDO480112345O01480000000000000055568014150738  00000000000000001000
001244803ORDORDO480112345O01480000000000000050216014200672  00000000000000001000
001244803ORDORDO480112345O01140000000000000007063036011446  00000000000000001000
001244803ORDORDO480112345O01130000000000000018862096011337  00000000000000001000


I need to remove all the header lines except the first one, so the sorted file should look like this
Code:

00124       0000000000000620070412150000002007041214534900                     
001244801ORDORDO480112345O01010000000000000032031017200002  00000000000000001000
001244801ORDORDO480112345O01290000000000000000793084020061  00000000000000001000
001244801ORDORDO480112345O01480000000000000055568014150738  00000000000000001000
001244801ORDORDO480112345O01480000000000000050216014200672  00000000000000001000
001244801ORDORDO480112345O01140000000000000007063036011446  00000000000000001000
001244801ORDORDO480112345O01130000000000000018862096011337  00000000000000001000
001244802ORDORDO480112345O01010000000000000032031017200002  00000000000000001000
001244802ORDORDO480112345O01290000000000000000793084020061  00000000000000001000
001244802ORDORDO480112345O01480000000000000055568014150738  00000000000000001000
001244802ORDORDO480112345O01480000000000000050216014200672  00000000000000001000
001244802ORDORDO480112345O01140000000000000007063036011446  00000000000000001000
001244802ORDORDO480112345O01130000000000000018862096011337  00000000000000001000             
001244803ORDORDO480112345O01010000000000000032031017200002  00000000000000001000
001244803ORDORDO480112345O01290000000000000000793084020061  00000000000000001000
001244803ORDORDO480112345O01480000000000000055568014150738  00000000000000001000
001244803ORDORDO480112345O01480000000000000050216014200672  00000000000000001000
001244803ORDORDO480112345O01140000000000000007063036011446  00000000000000001000
001244803ORDORDO480112345O01130000000000000018862096011337  00000000000000001000


I have tried using DFSORT but have not been successful. Can this be done with 1 DFSOFT statement, or does it need to be done in multiple steps? Thanks.
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 May 04, 2007 4:01 pm    Post subject: Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed the header records could be identified by '00000000' in positions 13-20.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(13,8,CH,EQ,C'00000000'),
    OVERLAY=(81:C'H',SEQNUM,1,ZD))
  OUTFIL OMIT=(81,1,CH,EQ,C'H',AND,82,1,ZD,GT,+1),
    BUILD=(1,80)
/*

_________________
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
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