Can anyone please help me out for a file comparision and updation,
File - 1
********
Type - VB, LRECL=2000
File - 2
********
Type - VB, LRECL = 80
Output File
***********
Type - VB, LRECL=2000
Condition
*********
1) It need to pull all the records from File - 1 to the output file where the content of 1 to 8 position of file-2 matches with position from 10 to 8 character of file-1.
2) The output file should be formatted for the fetched records with below condition,
a) If the value in position 155 to 1 character is Space, then the value at 155 position needs to update that with Y.
b) If the value in position 180 to 5 character is Space, then the value at 180 position needs to update that with XXXXX.
c) If the value in position 500 to 1 character is Space, then then the value at 500 position needs to update that with Z.
d) If the value in position 1000 to 1 character is Space, then then the value at 1000 position needs to update that with Z.
e) If the value in position 3 is 0, then update the position from 750 to 6 character as PPPPPP. (Even if previously in that field we have some value)
f) If the value in position 3 is 1, then update the position from 750 to 6 character as QQQQQQ. (Even if previously in that field we have some value)
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
If you search in this part of the forum (DFSORT) there are many examples of JOINKEYS (which will match the files as you want) and then use IFTHEN to change the values you want to change.