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

Comparing two fields in two different files using SORT


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

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Wed Oct 17, 2007 7:51 pm
Reply with quote

We have 2 diff date fields in 2 diff files.
1) A-date - in A file - pic 9(07) comp-3 , offset 100
2) B-date - in B file - pic 9(07) comp-3 , offset 200

Both A & B are fixed length VSAM files.

I want to extract those account which satisfies below condtion:

If A-date > B-date
extarct accts from A file into C-file
end-if
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Oct 17, 2007 9:15 pm
Reply with quote

Hello,

Your post is not at all clear.

Please post sample data from both files (several records) and what the output should be.
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: Wed Oct 17, 2007 10:33 pm
Reply with quote

Quote:
Please post sample data from both files (several records) and what the output should be.


Include only relevant fields (e.g. account, date) in the examples.

And in addition to that, provide this information:

pic 9(07) comp-3 is a 4-byte PD field. What is the form of the date (e.g. P'yyyyddd')?

Give the starting position, length and format of all relevant fields.

What is the length of the records in each VSAM file?

Do you want to compare the dates for the same account number in each file, or do you want to compare the dates some other way? Show and explain what you want with the example.
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Fri Oct 19, 2007 6:58 pm
Reply with quote

File-A

01 A-RECORD
05 A-ORG PIC X(03)
05 A-DATE PIC S9(07) COMP-3

FILE-B

01 B-RECORD
05 B-ORG PIC X(03)
05 B-ACCOUNT PIC X(19)
05 B-DATE PIC S9(07) COMP-3

Both date is in JULIAN FORMAT (YYYYDDD)

File A is control record file which contains only 2 fields, A-org and A-date.
There is no any account number present in this file.
File B is

now i want to extract all accounts from file B if it matches below condition:

If B-DATE > A-DATE
write B-record into OUTPUT file
end-if
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 19, 2007 7:07 pm
Reply with quote

Hello,

As this is the DFSORT area of the forum, it would be better to show sample input and output data, show the attributes/displacements into the data of the relevant fields as well as mentioning lrecl/recfm for all files.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top