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

Comparison of dates in 2 files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Sat Jun 17, 2006 12:59 am
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
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 Developer


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

PostPosted: Tue Jun 20, 2006 8:50 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top