The self-contained REXX code example below will generate a formatted OMIT
statement (using a 365 day cutoff) to an output DD (passed as the REXX EXEC
invocation argument).

Sincerely,

Scott Barry
SBBWorks, Inc.

___________________________


//STEP0    EXEC PGM=IEBGENER                                 
//SYSPRINT DD   DUMMY                                        
//SYSIN    DD   DUMMY                                        
//* TEMPORARY PDS ALLOCATION BELOW WITH MEMBER NAMED REXXPGM.
//SYSUT2   DD  DISP=(NEW,PASS),                              
//  DSN=&&REXXPDS(REXXPGM),                                  
//  UNIT=SYSALLDA,SPACE=(TRK,(1,1,1))                        
//* REXX CODE BELOW IS CREATED IN SYSUT2 MEMBER NAMED ABOVE. 
//SYSUT1   DD   DATA,DLM=ZZ                                  
/* REXX */                                                   
arg outdd                                                    
cutoff = DATE('B') - 365                                     
omitstr = substr(DATE('S',cutoff,'B'),1,4)||'-'||,           
          substr(DATE('S',cutoff,'B'),5,2)                   
queue " OMIT COND=(21,7,CH,LT,C'"omitstr"')"                 
"EXECIO * DISKW" outdd "(FINIS"                              
exit                                                         
ZZ                                                           
//*                                                          
//STEP1    EXEC  PGM=IRXJCL,PARM='REXXPGM SORTFILT'          
//SYSEXEC  DD   DISP=(OLD,DELETE),DSN=&&REXXPDS              
//SORTFILT DD   SYSOUT=*                                     
//SYSTSPRT DD   SYSOUT=*                                     
//SYSTSIN  DD   DUMMY                                        


> -----Original Message-----
> From: IBM Mainframe Discussion List On Behalf Of Ed Long
> 
> Hi all.
> I'm trying to develop a simple purge using DFSORT that drops 
> all records in the input older than 1 year. The target field 
> is an externalized DB2 timestamp.
> So far, the following works, sort of, but is not very 
> elegant. Any suggestions?
> 
> SORT FIELDS=(COPY) 
> 
> INCLUDE COND=(21,7,CH,EQ,C'2004-07',OR,
> 
> ...
> 
> 21,7,CH,EQ,C'2005-07') 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to