View previous topic :: View next topic
|
Author |
Message |
Valli Vaithilingam
New User
Joined: 13 Oct 2009 Posts: 11 Location: India
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
Valli Vaithilingam
New User
Joined: 13 Oct 2009 Posts: 11 Location: India
|
|
|
|
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 |
|
|
Valli Vaithilingam
New User
Joined: 13 Oct 2009 Posts: 11 Location: India
|
|
|
|
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 |
|
|
Valli Vaithilingam
New User
Joined: 13 Oct 2009 Posts: 11 Location: India
|
|
|
|
These three i/p files are temp files .
No limits on LRECL & RECFM |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Valli Vaithilingam wrote: |
These three i/p files are temp files .
No limits on LRECL & RECFM |
Is it a homework??? or you are getting this done for fun
BTW none of input you have shown is having count (pos:5 len:2) at line now 3? |
|
Back to top |
|
|
Valli Vaithilingam
New User
Joined: 13 Oct 2009 Posts: 11 Location: India
|
|
|
|
Sambhaji wrote: |
Valli Vaithilingam wrote: |
These three i/p files are temp files .
No limits on LRECL & RECFM |
Is it a homework??? or you are getting this done for fun
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
Plz ignore my initial post about count field . Juzt have the code for ref and help me !! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|