Posted: Mon Feb 16, 2009 9:26 pm Post subject: how to read particular record out of several record everytim

I have input file of LRECL=133 where I have got 65 records for every employee having diff information on each record.Out of 65th I need to check 7th record(or 7th line) 34th position of every employee and need to search whether I have same value in Second file .Second file has LRECL =80 but will contain only 4 digit value.If i found same value in 7th record of 1st file present in as that of second file I need to place N on 125th position in 7th record of the first file.I need to search second file because I dont know where the value will be may be at last

For Ex think following line is 7th record of 1st employee and have got 0830 value in 34th position now i need to search whether 0830 value present in second file.If yes I need to Place N in 125th column of same 7th record of an employee
34th Position 125th Position
11889 DOUGLAS DR 0830 0030 053 N

I guess your first file is a VSAM . If not create it that way because the performance wil be too good. Create the key in such a way that for a particular employee u can identify all the 65 records independently.

Using the key read the first file and then perform your required operation...
It would be good if you could specify the second file as VSAM too.

REMEMBER to open our ur first file in I-O mode...and take file backups before running the programs

Read all 65 records into an array, then use reference modification to identify the appropriate fields to access and change. You can then write all 65 array elements to your output file. I don't think you can do this without having an input file and an output file unless you change the file from sequential to VSAM.

Posted: Fri Feb 20, 2009 9:23 pm Post subject: How to rewrite the records or store the records in array

I have input file of LRECL=133 where I have got 65 records for every employee having diff information on each record.Out of 65th I need to check 7th record(or 7th line) 34th position of every employee and need to search whether I have same value in Second file .Second file has LRECL =80 but will contain only 4 digit value.If i found same value in 7th record of 1st file present in as that of second file I need to place N on 125th position in 1st record of the first file.I need to search second file because I dont know where the value will be,it may be at last also.

Remember I need to update in First record based on values of 7th record and second file value

For Ex think following line is 7th record of 1st employee and have got 0830 value in 34th position now i need to search whether 0830 value present in second file.If yes I need to Place N in 125th column of 1st record of every employee(not in the same 7th records but 1st record)

First record, 7th record, 65th record ... it doesn't matter. The same basic method is used. Read all records into an array, do what you want using the array, then output all the array elements to your file.

I want to read 65 records of lrecl 150 each from a input flat file until employee number changes and need to store it in an array.after storing I need to retrieve piece of data from 7th record and need to search in a table if same value present in table also i need to retreive 1st record from array and need to update 125th position and need to write full 65 records to output file and need to proceed with second 65 records for an second employee like wise till the end of first input file

Actually, it will be more help for you to write the code and learn by so doing.

Your description says what you want to do, so you need to put the code in place:
Define the files and the array.
Write the code to read the file and put the records for an employee into the array.
Perform a routine to work with the employee in the array (don't forget to process the array one more time at eof so the last employee will be processed).
Once the array has been processed, write the updated array entries to a new output file.

If you get stuck, post what you have and your question. Someone will be able to help.

1) Input file with LRECL=140 will have 65 records for each employee and can have several employees like wise and each employee with 65 records

2)second input file with lrecl=80 but got data only in first 4 columns(i.e Pic X(4))

Now i need to search 4 columns from 34th position of 7th record out of 65 records of each employee and I need to search whether same 4 digit value present in second input file.If Yes I need to update 125th position of 1st record of 65 records of every employee and need to write all 65 records to output file if value doesnt found in input file i need to write whole 65 records without updating any record. Like wise this should continue till last employee in input file

You have asked the same general question three times.
First as a Syncsort question that got moved to COBOL, second as a COBOL question and third as a DFSort question.
Wht kind of solution are you looking for?