Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Muffazel,
It's not clear what you want to do. You say you want to move the variables from file1 to file2. Do each of these files only have one record, or do they have more than one record. Do you want to move fields from record 1 of file1 to record 1 of file2, fields from record 2 of file1 to record 2 of file2, etc? Or do you want to move fields between the records of the two files in some other way? How?
I see a FILE1-DCN field, but not a FILE1-DCN3 field. What is FILE1-DCN3?
I see a FILE1-BATCH field, but not a FILE1-BATCH3 field. What is FILE1-BATCH3?
Please show an example of the records in each input file and what you expect for output. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input files.
Arun,
I don't know what you're doing with the INREC statement you show, but whatever it is, it only operates on file, not two files as requested.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I hope I am clear.
No, you're not.
Quote:
Actually I have to move records from File1 to File2 and there can be more than one record in File1.
Again, how do you want to match up the records in file1 with the records in file2? One at a time (file1 record 1 with file2 record1, file1 record 2 with file2 record2? By a key in the two records (what key)? Some other way?
Please go back and read my first post and answer ALL of my questions, show the requested example of input and output records, and explain the "rules" for "move records from File1 to File2".
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Frank,
Quote:
Arun,
I don't know what you're doing with the INREC statement you show, but whatever it is, it only operates on file, not two files as requested.
I m not sure if I have really misunderstood the OPs requirement. But from whatever he has posted, it seems like he just want to copy records from input to output ;but with a change in the layout.
Quote:
Again, how do you want to match up the records in file1 with the records in file2?
Muffazel said he just want to move records from file1 to file2. He has not mentioned anything about file-matching.
Muffazel,
Can you try this JCL. If this does not satisfy your requirement, you need to explain the rules in detail as Frank suggested.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Arun,
So you're saying that File1 here is the input and File2 is the output?
I assumed that when the OP said I have File1 and File2, he meant that these files already existed so he wanted to combine them in some way. But perhaps you're right that he really meant he has File1 and wants to create File2 from it. Sometimes the words people use can be quite misleading.
Confusing things more, you showed him a solution based on that assumption earlier and he didn't come back and say "yes, that's what I need".