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
 

 

Comparing two fields in two different files using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Comparing two fields in two different files using SORT
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

Site Director


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

PostPosted: Wed Oct 17, 2007 9:15 pm    Post subject:
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 Moderator


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

PostPosted: Wed Oct 17, 2007 10:33 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Oct 19, 2007 7:07 pm    Post subject:
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    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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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