I have an input file with a few records. I need to search these records in an VSAM file one by one and if I find a matching record, then I need to update a field of that record in VSAM file with a fixed msg 'XXX'.
I am trying to avoid writing a new Cobol pgm for the above function. I'm not sure if it is possible using SYNCTOOL utility.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
if I find a matching record
Matching what? Matching a particular constant? Matching another field in the record? You need to explain clearly what it is you're trying to do.
Show an example of the records in your input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of all relevant fields.
Are all of the VSAM records the same length and can they be different lengths?
Ok...I apologize for posting incomplete information. Here it goes in details:
The input flat file contains the following data:
'Emp-no' of 14 chars starting at column 01.
The VSAM is the I/O file (300 chars in length) that has its key as the Emp no of 14 chars. A "notes" field of 30 chars starts at col 199 in the VSAM file
I need to match the Emp-no of the i/p file with the Emp-no of VSAM file. If it matches then I need to update the "notes field" of the VSAM file with a fixed msg 'XXX' of 30 chars.
How can I achieve this using ICETOOL utility? Hope this query is much clearer now.
You need to do this in 2 steps.
1) JOIN the flat file and VSAM file on keys and update the required field. This can be done using SPLICE.
2) Use the o/p of step 1 as input in this step. You can do REPRO REPLACE to your original vsam file. All the updated key recs will be reflected in your VSAM file.
You can use the below job to JOIN both the files. I am assuming that key of VSAM file also start at pos 1 and is of 14 chars.
Hi Kapil,
Thanks for the reply. I tried using your method but the JCL failed with U0016 abend code. It failed in the statement:
CP01CNTL :
OUTREC BUILD=(1,14,301:C''11'')
The cause of the failure was explained as follows:
SyncSort was invoked by another program, and that program used a 31-bit parameter list where the "call identifier" parameter
was specified. xxxx is the identifier specified by the calling program.
Sorry for the confusion. Uptill now, I thought your were using DFSORT.
If you are using SYNCSORT in your system. Then you should join files differently.
Try using the below JOB to JOIN both the files. Then do REPRO REPLACE to your original vsam file.