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
 

 

Files to extract INCLUDE only based on YEAR

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Tue Nov 26, 2013 8:09 pm    Post subject: Files to extract INCLUDE only based on YEAR
Reply with quote

Hello All,

I have an input file with date in packed decimal format in YYYYNNN (julian) format. I need to extract the records only when the year is equal to current year. Assume i have an input like below,
Code:
                  2013184                        0               400.00 
                  2013226                        0                53.58 
                  2012261                        0                11.11 
                  2012293                        0               127.43 
                  2012263                        0                29.70 

Now i should get output only below.
Code:
                  2013184                        0               400.00 
                  2013226                        0                53.58   

It should be done for every year, I have seen so far only the date comparison using DATE function which includes month and day, but i need to filter only based on year. It would be better if someone could provide the suggestion.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 26, 2013 8:36 pm    Post subject:
Reply with quote

Hello,

Create SYMNAMES that have the previous and next year.

Compare the input year to be sure it is between the 2 calculated years.
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Tue Nov 26, 2013 8:39 pm    Post subject:
Reply with quote

Hi Dick, thanks for the reply, could you explain in detail.. if possible.,
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Tue Nov 26, 2013 8:53 pm    Post subject:
Reply with quote

dudenithy wrote:
Hi Dick, thanks for the reply, could you explain in detail.. if possible.,


Dick, I understood now icon_smile.gif took in a other way and confused icon_redface.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 26, 2013 9:03 pm    Post subject:
Reply with quote

Hello,

So, it is now working for you?

If you post your solution, it will help someone with a similar question some day.
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Tue Nov 26, 2013 9:16 pm    Post subject:
Reply with quote

No, i haven't done yet, ve to go back office tomorrow and then try it.. but as the logic was clear, it should work !!
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 26, 2013 9:23 pm    Post subject:
Reply with quote

Ok, we'll be interested to hear it went well icon_cool.gif

d
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Nov 27, 2013 11:49 am    Post subject:
Reply with quote

Hi Dick,

Not sure why you wanted two years in symnames but I tried the below code

Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SYMNAMES DD *
CCYY,S'&YR4'
//SORTIN   DD *
2013184                        0               400.00
2013226                        0                53.58
2012261                        0                11.11
2012293                        0               127.43
2012263                        0                29.70
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=COPY
  INCLUDE COND=(1,4,CH,EQ,CCYY)


Output

Code:
********************************* TOP OF DATA **********************************
2013184                        0               400.00
2013226                        0                53.58
******************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7230

PostPosted: Wed Nov 27, 2013 12:55 pm    Post subject: Reply to: Files to extract INCLUDE only based on YEAR
Reply with quote

OK, and now the packed-decimal part. It can be done without data manipulation.

Also document as not working if the step is run in the "wrong" year.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Nov 27, 2013 7:47 pm    Post subject:
Reply with quote

Hello,

Quote:
Not sure why you wanted two years in symnames

I used 2 years so that when the requirement is for more than one year, there is little/no change to accommodate this.

Code:
  INCLUDE COND=(1,4,CH,EQ,CCYY)
Probably not as the data is packed-decimal . . .
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Nov 27, 2013 8:39 pm    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

Quote:
Not sure why you wanted two years in symnames

I used 2 years so that when the requirement is for more than one year, there is little/no change to accommodate this.

Code:
  INCLUDE COND=(1,4,CH,EQ,CCYY)
Probably not as the data is packed-decimal . . .

Got it..Thanks
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Nov 28, 2013 12:35 am    Post subject:
Reply with quote

use the following control cards. I assumed that your input has RECFM=FB and LRECL=80

Code:

//SYMNAMES DD *     
CURRYR,S'&LYR4'     
//SYSIN    DD *                                   
  OPTION COPY                                     
  INREC OVERLAY=(81:19,4,Y4U)                     
  OUTFIL BUILD=(1,80),INCLUDE=(81,4,CH,EQ,CURRYR) 
//*
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 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
No new posts Wishing everyone a very Happy Diwali ... Rohit Umarjikar General Talk & Fun Stuff 1 Sat Oct 29, 2016 1:54 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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