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

How to extract the data for current year and previous year


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

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Thu Jan 05, 2023 10:20 pm
Reply with quote

Hello,

I have a year the in the input file. I have to extract data for current year and previous year only using sort card. Please help

Thanks
Venkat
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Jan 05, 2023 10:26 pm
Reply with quote

Venkata Ramayya wrote:
Hello,

I have a year the in the input file. I have to extract data for current year and previous year only using sort card. Please help

Thanks
Venkat


So far, what did you try, and what prevents you from getting any (maybe wrong) result?

Did you try this, for example?
Code:
 INCLUDE COND=(select-only-required-years)
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Thu Jan 05, 2023 11:14 pm
Reply with quote

No I have not tried anything. Year is not static value in this case. It will keep changing every year. I think I need to use some date function in the sort card. I need help on that. Thanks
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Jan 05, 2023 11:24 pm
Reply with quote

Venkata Ramayya wrote:
No I have not tried anything. Year is not static value in this case. It will keep changing every year. I think I need to use some date function in the sort card. I need help on that. Thanks


Please, RTFM. DFSORT Application Programming Guide

Everything is explained in details, with multiple examples.
Try at least something; then you may ask for help.

Good luck!
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Thu Jan 05, 2023 11:38 pm
Reply with quote

I thought someone would post an example here. Anyways, thanks for the document. I will take a look.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Jan 06, 2023 5:14 am
Reply with quote

Cleaned up and let us adhere to the forum rules.

You need to show us sample data and expected output for anyone here to help you. I restate to search this forum for having many examples of how to filter on dates in include condition.

Try it .
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1244
Location: Bamberg, Germany

PostPosted: Fri Jan 06, 2023 6:28 pm
Reply with quote

You could use DATE<n> and DATEDIFF to build symbolics in a first step. In the next step compare against the freshly created SYMNAMES. This is not much lines of code.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Sat Jan 07, 2023 2:50 am
Reply with quote

Agree with Joreg but can be done in a single step. This is how it can be used, just replace with your year.
ibmmainframes.com/about57873.html
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1244
Location: Bamberg, Germany

PostPosted: Mon Jan 09, 2023 1:01 pm
Reply with quote

Minor mistake by me, but the solution is on the same page in DFSORT manual as DATEDIFF. Obviously it should be SUBYEARS keyword (as I have used in my test case).
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 Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top