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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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