IBM DFSORT - Retrieving only the current year for comparison

2

Let's say that I have a "Year" column in a file. And I would like to bring in the new file, only the records in which the YEAR is greater than the "current year". How to recover the current year?

The command DATE1 returns the complete date: yyyymmdd .

I only need: yyyy .

Example:

INCLUDE COND=(1107,04,CH,GE,YYYY)        ** VIGENCIA >= ANO ATUAL
    
asked by anonymous 30.01.2014 / 14:27

1 answer

3
//GEANO    EXEC PGM=SORT 
//SYMNAMES DD * 
ESTA-ANO,S'&YR4' 
//SYMNOUT DD SYSOUT=* 
//SYSOUT   DD SYSOUT=* 
//SORTOUT  DD SYSOUT=* 
//SYSIN    DD * 
  OPTION COPY 

  INCLUDE COND=(1,4,CH,GE,ESTA-ANO)
//SORTIN   DD * 
AAAA 
2017 
2012 
2013 
2014 
2015 
2014 
2014 
2019 
2031 
20E4 

Results:

2017
2014
2015
2014
2014
2019
2031

& YR4 is a system symbol. They can be used with DFSORT siboes, through S'...' in //SYMNAMES DD . See //SYMNOUT DD for translation of simbois, and SYSOUT for translation of control letters.

Sorry. I do not speak Portuguese well, but I speak a lot DFSORT :-)

    
30.01.2014 / 16:59