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 

Want to delete extra headers from the file.

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


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Tue Nov 25, 2008 12:02 pm    Post subject: Want to delete extra headers from the file. Reply with quote

Hi All,

I am generating a final report by concatinating different reports. While concatinating i want to remove extra headers

Data in file
Code:
Name         ID
----------   -----------
Siva         1234G56
Malli        1234VFS
Nishant      23456TF
Name         ID
----------   -----------
Rama         1234333
Aizaz        1234VFS
Name         ID
----------   -----------
Giri         1234444
Naveen       1234VZS


I want the final file like this
Code:
Name         ID
----------   -----------
Siva         1234G56
Malli        1234VFS
Nishant      23456TF
Rama         1234333
Aizaz        1234VFS
Giri         1234444
Naveen       1234VZS


Thanks,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Nov 25, 2008 12:21 pm    Post subject: Reply with quote

sivafdms,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                     
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
NAME         ID                                               
----------   -----------                                       
SIVA         1234G56                                           
MALLI        1234VFS                                           
NISHANT      23456TF                                           
NAME         ID                                               
----------   -----------                                       
RAMA         1234333                                           
AIZAZ        1234VFS                                           
NAME         ID                                               
----------   -----------                                       
GIRI         1234444                                           
NAVEEN       1234VZS                                           
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  OUTREC IFTHEN=(WHEN=(1,4,CH,EQ,C'NAME',OR,1,4,CH,EQ,C'----'),
  OVERLAY=(81:SEQNUM,3,ZD))                                   
  OUTFIL BUILD=(1,80),OMIT=(81,3,ZD,GT,2)                     
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Tue Nov 25, 2008 1:40 pm    Post subject: Reply with quote

Hi Kolusu,

Thanks for above jcl that work fine for only when there are three headers in the file what about the if we don't know the no of headers present in the file.

Thanks,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Nov 25, 2008 1:44 pm    Post subject: Reply with quote

sivafdms wrote:
Hi Kolusu,

Thanks for above jcl that work fine for only when there are three headers in the file what about the if we don't know the no of headers present in the file.

Thanks,
Siva


*Sigh* did you even run the job with more headers and see if the job did not give you the desired results? Trust me the job works FINE with any number of headers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Tue Nov 25, 2008 1:46 pm    Post subject: Reply with quote

Here's an alternative set of DFSORT control statements to do the same thing. Both alternatives will handle any number of headers.

Code:

  OPTION COPY                                                 
  INREC OVERLAY=(81:SEQNUM,8,ZD)                               
  OUTFIL OMIT=(81,8,ZD,GT,2,AND,1,4,SS,EQ,C'NAME,----'),       
    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