Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compare and INCLUDE recs based on Current Year(CCYY)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Compare and INCLUDE recs based on Current Year(CCYY)
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 Moderator


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

PostPosted: Tue Jan 12, 2010 10:52 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts For each given key value, how to keep... Div Grad DFSORT/ICETOOL 7 Fri Nov 11, 2016 11:38 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us