Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us