query regarding matching field value

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply

query regarding matching field value

Post by jasveer » Mon Feb 20, 2006 1:54 pm

hi all
i have a query.
actually i have an input file which has records beginning with a PIC XX field which can hold value 11,14,15,21.it has one more field pic x(15).
now i wanna move all fields from record starting with 11 to a output file.if the picx(15) digit of 11 matches with that of record whose pic xx =21, then i wanna move one field from 21 to corresponding field in output of 11.
let me explain it further.
if one record is 11 123 112123123123123 31 & another record is
21 333 112123123123123 23
record 11 has same pic x(15) as that of 21 so move 31 from 11 and 21 from 21 to same record of output file

User avatar
Posts: 17
Joined: Thu Feb 16, 2006 5:27 pm

Post by Rupesh.KOthari » Mon Feb 20, 2006 2:44 pm

HI Jasveer,

COuld you please let us know what exact output do you want :?:

Thanks & Regards
Sun Shines Everywhere



Post by jasveer » Mon Feb 20, 2006 3:21 pm

hi rupesh
thanks for the concerns
well we have an input file like
1st 2nd 3rd field 4th
11 123 133333444555555 33
14 321 133234235455555 45
21 321 133333444555555 62

if the 3rd field i.e. pic x(15) of the 11( 1st field ) and 21( 3rd field) are same then move 33( 4th ) from 11 and 62(4th) from 21 to the output file.
the output file should be like( becoz the 3rd fields of 11 and 21 are equal)

1st 2nd 3rd
133333444555555 33 62

Posts: 1
Joined: Mon Feb 20, 2006 3:34 pm

reply for rupesh

Post by jasveer » Mon Feb 20, 2006 3:51 pm

hi rupesh
Again saying that its some what related to costumers details.

lets say that for same name we have two records
the first having the costumer name,address,
the second one having the name and dob.
if the name for the two records is same then all the fields of the two records should come in single record of the output file .
its like gathering the info of the same costumer from various records thru their identification number and creating an output file thru the same.

Post Reply


Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Mainframe Interview questions

Other References
Mainframe Tools and others