View previous topic :: View next topic |
Author |
Message |
mnandyal Beginner
Joined: 21 Apr 2003 Posts: 3 Topics: 1 Location: Indore
|
Posted: Tue Apr 22, 2003 1:46 am Post subject: How Can I Get This From SORT or EZT ? |
|
|
Hi ,
I am having 2 files OF FIXED LENGTH 80 . like below.
The content of file FILE A:
CR3004485
CR3006516
CR3088245
CR3089123
CR3500366
CR3000067
The content of file b:
++GROUP
2652,CR3000047 ; PHASE=001; RTYP=F; RTYPID=SRY900Z1; RCOMPANY=SR ;
RUSE=1; RAMT=0000900;.
++GROUPEND
++GROUP
2652,CR3006516 ; PHASE=001; RTYP=F; RTYPID=SRY900Z1; RCOMPANY=SR ;
RUSE=1; RAMT=0000900;.
++GROUPEND
++GROUP
2652,CR3000058 ; PHASE=001; RTYP=F; RTYPID=SRY900Z1; RCOMPANY=SR ;
RUSE=1; RAMT=0001600;.
++GROUPEND
++GROUP
2652,CR3000059 ; PHASE=001; RTYP=F; RTYPID=SRY900Z1; RCOMPANY=SR ;
RUSE=1; RAMT=0002000;.
++GROUPEND
++GROUP
2652,CR3000067 ; PHASE=001; RTYP=F; RTYPID=LNCK0082; RCOMPANY=LN ;
RUSE=1; RAMT=0001500;.
++GROUPEND
++GROUP
2652,CR3000067 ; PHASE=002; RTYP=F; RTYPID=LNCK0082; RCOMPANY=LN ;
RUSE=1; RAMT=0001500;.
++GROUPEND
I need to create a third file having all the data starting from ++GROUP to +GROUPEND when the number(CRXXXXXX) matches. Means the output(third ) file should be like below.
++GROUP
2652,CR3006516 ; PHASE=001; RTYP=F; RTYPID=SRY900Z1; RCOMPANY=SR ;
RUSE=1; RAMT=0000900;.
++GROUPEND
++GROUP
2652,CR3000067 ; PHASE=001; RTYP=F; RTYPID=LNCK0082; RCOMPANY=LN ;
RUSE=1; RAMT=0001500;.
++GROUPEND
++GROUP
2652,CR3000067 ; PHASE=002; RTYP=F; RTYPID=LNCK0082; RCOMPANY=LN ;
RUSE=1; RAMT=0001500;.
++GROUPEND
Thanks in advance. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Apr 22, 2003 4:08 pm Post subject: |
|
|
mnandyal,
The data is not sorted in either files and there are duplicates in the second file. unless you read the second file multiple times , you will not be able to get the desired results.
Kolusu |
|
Back to top |
|
 |
mnandyal Beginner
Joined: 21 Apr 2003 Posts: 3 Topics: 1 Location: Indore
|
Posted: Tue Apr 22, 2003 11:06 pm Post subject: |
|
|
Hi Kolusu,
Thank you very much for your reply.
You mean to say that I need to go for cobol program?
One more thing I can go for sorting of the file1.
I tried to modify and get the desired results from the COBOL program which you kept in the same forum.But I am unable to get the desired results.Can you help me out. |
|
Back to top |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Wed Apr 23, 2003 5:06 am Post subject: |
|
|
mnandyal,
I posted a soultion here _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
 |
|
|