IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort and Merge of Two files with their header removed


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Wed Jun 24, 2009 12:29 pm
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: 8797
Location: Welsh Wales

PostPosted: Wed Jun 24, 2009 12:41 pm
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
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: Canada

PostPosted: Wed Jun 24, 2009 2:19 pm
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: 1287
Location: Chennai, India

PostPosted: Wed Jun 24, 2009 2:20 pm
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: Canada

PostPosted: Thu Jun 25, 2009 12:00 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top