Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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)
/*
|
|
|