View previous topic :: View next topic
|
Author |
Message |
essence21
New User
Joined: 05 Dec 2008 Posts: 20 Location: mumbai
|
|
|
|
Hi,
I have 3 input files.
**************************
File 1 (No header/Trailer)
Code: |
Field1;Field2;Field3;Field4;USERID;LOGONDATE;Field7;Field8
Field1;Field2;Field3;Field4;USERID;LOGONDATE;Field7;Field8
Field1;Field2;Field3;Field4;USERID;LOGONDATE;Field7;Field8
|
LOGON date is in Julian Date (YYYYDDD)
**************************
File 2
Code: |
10Header
20MiscData
25MiscData
50Field1;Field2;Field3;Field4;USERID;LOGONDATE;Field7;Field8
50Field1;Field2;Field3;Field4;USERID;LOGONDATE;Field7;Field8
50Field1;Field2;Field3;Field4;USERID;LOGONDATE;Field7;Field8
90Trailer
|
LOGON date is in Julian Date (YYYYDDD)
*************************
File 2
Code: |
10Header
20MiscData
25MiscData
50Field1;Field2;Field3;USERID;LOGONDATE;Field6;Field7
50Field1;Field2;Field3;USERID;LOGONDATE;Field6;Field7
50Field1;Field2;Field3;USERID;LOGONDATE;Field6;Field7
90Trailer
|
LOGON date is in Julian Date (YYYYDDD)
*************************
Now output criteria is like USERID of FILE 1 is present in FILE 2 or FILE 3 then check for latest LOGON date. That date will replace the date prestnt in file 1. If the userid in file 1 is not present in file 2 or 3 then that record in file 1 is left as it is.
Is such a thing possible using DFSORT? A friend was suggesting via batch code but I thought it would be way too complex and resource consuming
Appreciate your help. Please let me know if any other data required. It will FB file |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please show examples of the records in each input file with actual values rather than Field1, etc. Show the expected output records.
Give the RECFM and LRECL of each input file.
If the fields are fixed length, give the starting position, length and format of each relevant fields. If the fields are delimited, indicate that.
Quote: |
Is such a thing possible using DFSORT? A friend was suggesting via batch code but I thought it would be way too complex and resource consuming |
I don't know what you mean by "batch code". DFSORT is a batch program. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Frank,
Quote: |
I don't know what you mean by "batch code". |
COBOL, Easytrieve, etc. . . |
|
Back to top |
|
|
essence21
New User
Joined: 05 Dec 2008 Posts: 20 Location: mumbai
|
|
|
|
Thanks Dick.
Frank, here are some same files,
File 1
Code: |
JohnB,SmithBBBBBBBBBBBBBBBBBBB,WXYZ,123456789,USER123,2008065,S,PPPPPPPP
|
The user id is User123
The Last Logon Date is 2008065
The character B indicates Blanks just for better understanding
File 2
Code: |
50AMMMMMB 20090113.CICSDFLT.USER123 .2008346.00005.00000000056.00000001 |
The user id is User123
The Last Logon Date is 2008346
File 3
Code: |
50AMMMMMB 20090113.USER123 .2008366.00020.00000004172.00000013......... |
The user id is User123
The Last Logon Date is 2008366
So since file 3 contains most recent Last Logon Date
The File 1 will now become
File 1
Code: |
JohnB,SmithBBBBBBBBBBBBBBBBBBB,WXYZ,123456789,USER123,2008366,S,PPPPPPPP
|
The idea is to check if the userid in file 1 is present in file 2 or file 3. If present then the latest logon date is updated in file 1.
Hope this helps. |
|
Back to top |
|
|
|