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
 

 

Comparison of dates in 2 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
nikyojin

New User


Joined: 05 Oct 2005
Posts: 94

PostPosted: Sat Jun 17, 2006 12:30 am    Post subject: Comparison of dates in 2 files
Reply with quote

Hi,
I have got 2 files
1st file :-Acct Info

Code:

Act-Key      Acct-St-Dt        Acct-End-Dt   Acct-end-dt-null-ind
    1        2006-01-01        2006-04-30
    2        2006-02-01        2006-05-31
    3        2006-03-01                                  ?
    4        2006-05-01        2006-06-30
    5        2005-05-01                                  ?


2nd file :- Batch Date
2006-06-15

The 2 files are to be compared and all the Accounts having null end-date
or Acct-end-dt > batch-date should be present in the o/p file.

From the example above the O/p file must contain the following records

Code:

Act-Key      Acct-St-Dt        Acct-End-Dt   Acct-end-dt-null-ind
    3        2006-03-01                                  ?
    4        2006-05-01        2006-06-30
    5        2005-05-01                                  ?


Please tell me how to achieve this......
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: Sat Jun 17, 2006 12:59 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. You didn't give many details, so I just made assumptions. You can change the job appropriately as needed.

Code:

//S1    EXEC PGM=ICEMAN
//SYSOUT    DD SYSOUT=*
//SORTIN DD *
2006-06-15
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
  OPTION COPY
* Create DFSORT symbol for batch date as:
* Batch_date,'yyyy-mm-dd'
  OUTREC FIELDS=(C'Batch_date,''',1,10,C'''',80:X)
/*
//S2    EXEC PGM=ICEMAN
//SYSOUT    DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
    1        2006-01-01        2006-04-30
    2        2006-02-01        2006-05-31
    3        2006-03-01                                  ?
    4        2006-05-01        2006-06-30
    5        2005-05-01                                  ?
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
* Include records with null end-date or with
* end-date > Batch_date
  INCLUDE COND=(32,10,CH,EQ,C' ',OR,
    32,10,CH,GT,Batch_date)
/*
Back to top
View user's profile Send private message
nikyojin

New User


Joined: 05 Oct 2005
Posts: 94

PostPosted: Tue Jun 20, 2006 5:32 pm    Post subject: Re: Comparison of dates in 2 files
Reply with quote

Thanks Frank.....SYMNAMES is real good feature included in DFSORT.
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 Jun 20, 2006 8:50 pm    Post subject:
Reply with quote

Quote:
SYMNAMES is real good feature included in DFSORT.


I'm glad you like it. SYMNAMES has actually been available in DFSORT since 1998.
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 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
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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