Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compare 3 files and create output File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Compare 3 files and create output File
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 Moderator


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

PostPosted: Tue Dec 08, 2009 12:31 am    Post subject:
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

Site Director


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

PostPosted: Tue Dec 08, 2009 12:38 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us