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

Merging of Files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Valli Vaithilingam

New User


Joined: 13 Oct 2009
Posts: 11
Location: India

PostPosted: Fri Apr 09, 2010 11:03 am
Reply with quote

Hi , I need to merge the records of 3 files .

But , i ll have to check the count field (count field will be in the line 3 of the file , pos : 5 , len :2) in the file and only if is greater than 05 , i ll have to take that file into account else i ll have to drop that file from being merged .

How can i achieve this ? plz help me .
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Fri Apr 09, 2010 11:13 am
Reply with quote

Assist with following...

1: Show us sample records in the file with expected output for the same.. both cases when file is skipped for merging and considered for merging(use code tags)

2: RECFM and LRECL of the file?
Back to top
View user's profile Send private message
Valli Vaithilingam

New User


Joined: 13 Oct 2009
Posts: 11
Location: India

PostPosted: Fri Apr 09, 2010 11:49 am
Reply with quote

File 1 :
Code:


------------------------------------------------
REASON : CASE-1                             
                                                 
  aaa            bbbb            ccc                   
------        ----------        ---------                 
000002   0000940010   000015557                 
000002   0000940278   000589246                 
000002   0000940284   000625529                 
000002   0000940330   000012446                 
000002   0000940331   000010667                 
                                                 
COUNT =000005                                   
------------------------------------------------



File 2 :

Code:


------------------------------------------------
REASON : CASE-2           

  aaa          bbbb                ccc                   
------        ----------          ---------                   
                                                 
COUNT =000000                                 
------------------------------------------------



File 3 :

Code:


------------------------------------------------
REASON : CASE-3                             
                                                 
  aaa          bbbb                ccc                   
------        ----------          ---------                 
000005   0007840010   000090057                 
000005   0009130278   000666246                 
         
COUNT =000002                                 
------------------------------------------------



File 1 & 3 are to be merged and 2 shud be dropped.

My o/p :
Code:


Header : Final Report After Merging
------------------------------------------------
REASON : CASE-1                             
                                                 
  aaa            bbbb            ccc                   
------        ----------        ---------                 
000002   0000940010   000015557                 
000002   0000940278   000589246                 
000002   0000940284   000625529                 
000002   0000940330   000012446                 
000002   0000940331   000010667                 
                                                 
COUNT =000005                                   
------------------------------------------------
------------------------------------------------
REASON : CASE-3                             
                                                 
  aaa          bbbb                ccc                   
------        ----------          ---------                 
000005   0007840010   000090057                 
000005   0009130278   000666246                 
         
COUNT =000002                                 
------------------------------------------------

Back to top
View user's profile Send private message
Valli Vaithilingam

New User


Joined: 13 Oct 2009
Posts: 11
Location: India

PostPosted: Fri Apr 09, 2010 11:51 am
Reply with quote

Misstated the count field in my initial post :
count field will be in the line 3 of the file , pos : 5 , len :2
Plz refer the code of my latest entry . That's the correct one

Count > 0 , should be merged.
Back to top
View user's profile Send private message
Valli Vaithilingam

New User


Joined: 13 Oct 2009
Posts: 11
Location: India

PostPosted: Fri Apr 09, 2010 11:55 am
Reply with quote

These three i/p files are temp files .

No limits on LRECL & RECFM
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Fri Apr 09, 2010 12:02 pm
Reply with quote

Valli Vaithilingam wrote:
These three i/p files are temp files .

No limits on LRECL & RECFM
icon_eek.gif

Is it a homework??? or you are getting this done for fun icon_evil.gif

BTW none of input you have shown is having count (pos:5 len:2) at line now 3?
Back to top
View user's profile Send private message
Valli Vaithilingam

New User


Joined: 13 Oct 2009
Posts: 11
Location: India

PostPosted: Fri Apr 09, 2010 12:09 pm
Reply with quote

Sambhaji wrote:
Valli Vaithilingam wrote:
These three i/p files are temp files .

No limits on LRECL & RECFM
icon_eek.gif

Is it a homework??? or you are getting this done for fun icon_evil.gif

BTW none of input you have shown is having count (pos:5 len:2) at line now 3?


@ Sambhaji : Not doing for fun at all .. Just wanted to learn . Am juz a beginner icon_sad.gif

Plz ignore my initial post about count field . Juzt have the code for ref and help me !!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Apr 09, 2010 9:57 pm
Reply with quote

Quote:
Plz ignore my initial post about count field . Juzt have the code for ref and help me !!


How can the count record be identified? Does it have 'COUNT' in positions 1-5?
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top