Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort and Merge of Two files with their header removed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Wed Jun 24, 2009 12:29 pm    Post subject: Sort and Merge of Two files with their header removed
Reply with quote

Hi,
I searched forum and google couldn't find any,not sure whether same type of topic was posted previously..

Here goes my question.
I have two files fileA and fileB with LREC of 80 ;Each of these files have a header and i need them to be removed from the output using SORT.

File A
Header
Data1
Data3
Data4

FileB
Header
Data2
Data6

Output File
Data1
Data2
Data3
Data4
Data6

I tried SKIPREC,it will remove header only from first file.Is there any other option to do it?
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 24, 2009 12:41 pm    Post subject:
Reply with quote

Are you using DFSORT or SYNCSORT as the solution may vary according to the product being used.
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Wed Jun 24, 2009 12:48 pm    Post subject:
Reply with quote

also show us sample example files.

How header and data records are identified? Is there a record type indicator in the file?
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Wed Jun 24, 2009 2:19 pm    Post subject:
Reply with quote

I am using SYNCSORT.
Header record(row) contains title and the remaining are data
Example
Header--> EmpNo Dept Salary
Data-----> 1234 Payroll 10000
2345 HR 5000

File2 also has the same format;I want header(or first record in the file) to be removed from all the input files and merge data alone from them.

I can use OMIT function having some part of header label but i guess it will not be generic because almost 5-6 files are to be merged which will have same data content but Header text can vary for each file.Moreover new files can be added.

I am trying to find whether there is any generic part of code which will move first record from each of the input file used irrespective of what is the content in it.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Jun 24, 2009 2:20 pm    Post subject: Reply to: Sort and Merge of Two files with their header remo
Reply with quote

Muthu,

Answer all the Questions posted.

Quote:
I searched forum and google couldn't find any


No, You did not.

These kind of topics have been debated to death.
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Thu Jun 25, 2009 12:00 pm    Post subject:
Reply with quote

I am explaining you the same scenario in another way,

Assume 10 files are sorted and merged into single file of same LREC using SYNCSORT.
My requirement is to remove the first record in each of the 10 files and create a sorted output irrespective of what data or type of data present in the first record.

Quote:
These kind of topics have been debated to death.


I will be very much glad if you get me one link with solution similar to my requirement usng 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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us