Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Comparing dates in different formats migusd SYNCSORT 4 Sat Nov 18, 2017 3:02 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us