IBM DFSORT - Recovering only the current year for comparison

Asked

Viewed 225 times

2

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

The command DATE1 returns the full date: yyyymmdd.

I just need: yyyy.

Example:

INCLUDE COND=(1107,04,CH,GE,YYYY)        ** VIGENCIA >= ANO ATUAL

1 answer

4


//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 

Resultos:

2017
2014
2015
2014
2014
2019
2031

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

Sorry. I don’t speak Portuguese well, but I speak a lot of DFSORT :-)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.