IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compare 3 files and create output File


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
essence21

New User


Joined: 05 Dec 2008
Posts: 20
Location: mumbai

PostPosted: Mon Dec 07, 2009 4:59 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 08, 2009 12:31 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Dec 08, 2009 12:38 am
Reply with quote

Hi Frank,

Quote:
I don't know what you mean by "batch code".
COBOL, Easytrieve, etc. . .
Back to top
View user's profile Send private message
essence21

New User


Joined: 05 Dec 2008
Posts: 20
Location: mumbai

PostPosted: Tue Dec 08, 2009 9:52 am
Reply with quote

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
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Joining files with intermittent heade... SYNCSORT 1
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts INPFIL FILES, FNAMES examples SYNCSORT 7
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
Search our Forums:


Back to Top