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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm

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