IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compare and INCLUDE recs based on Current Year(CCYY)


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bathrinarayanan

New User


Joined: 15 Nov 2007
Posts: 4
Location: chennai

PostPosted: Tue Jan 12, 2010 8:25 pm
Reply with quote

Hi,

I want to compare Year in the date field of a file with Current Year and INCLUDE such records into my output file. File attributes are FB, LRECL=80.
Sample Input file
Code:

Ref-No  Name             Date-field
4124323 BATHRINARAYANAN  20100112   
3134532 BATHRI           20090112   


My preferred output is
Code:

4124323 BATHRINARAYANAN 20100112

Since it is only matched with the current year 2010.

Please suggest a way to achieve it..

Thanks in Advance..
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 12, 2010 10:52 pm
Reply with quote

You can use a DFSORT job like the following to do what you asked for. I assumed your year starts in position 26.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD *
CURYR,S'&YR4'
/*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(26,4,CH,EQ,CURYR)
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top