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
 

 

Need to get the records which are LE to next year

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
srinivas_cog

New User


Joined: 05 Jun 2008
Posts: 17
Location: chennai

PostPosted: Mon Aug 24, 2009 4:02 pm    Post subject: Need to get the records which are LE to next year
Reply with quote

Hi,

I need to get all the records which are having the date less than or equal to next year's date.

Suppose if the job is running in 2010 then need to get all the records which are having the date lessthan or equal to 2012.

Input : file length : 180; date starts in 10th postion (20090824)

Please let me know if you have any ideas.

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

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Aug 24, 2009 4:07 pm    Post subject:
Reply with quote

Hi,

if it runs in 2010, would it not be LE 2011 ? or LT 2012 ?


Gerry
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Mon Aug 24, 2009 4:23 pm    Post subject:
Reply with quote

you can pass the current date using symname extract the year there are some format by which you can get the current year, just compare it with the date field present in your file,

I also agree with Gerry if you add want rec which has date less then next year then in above date will be less than 2011 and not 2012
Back to top
View user's profile Send private message
srinivas_cog

New User


Joined: 05 Jun 2008
Posts: 17
Location: chennai

PostPosted: Mon Aug 24, 2009 4:26 pm    Post subject: Reply to: Need to get the records which are LE to next year
Reply with quote

Hi Gerry,

I am sorry . it should be 2011 not 2012.

It should be LE to 2011

Thanks,
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: Mon Aug 24, 2009 8:33 pm    Post subject:
Reply with quote

Hello,

Quote:
Please let me know if you have any ideas.
Which sort product is used on the system?

Are either Easytrieve or FileAid available?
Back to top
View user's profile Send private message
srinivas_cog

New User


Joined: 05 Jun 2008
Posts: 17
Location: chennai

PostPosted: Tue Aug 25, 2009 9:57 am    Post subject: Reply to: Need to get the records which are LE to next year
Reply with quote

Hi Dick,

I am using SYNCSORT. Yes i can use fileaid also but not Easytrieve.

Thanks,
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Aug 25, 2009 10:09 am    Post subject:
Reply with quote

Hi,

try this
Code:
//*                                                                   
//S1       EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                       
001                                                                   
/*                                                                     
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)       
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  OPTION COPY                                                         
* CREATE SYMBOL AS FOLLOWS:                                           
* YEAR,'YYYY'                                                         
* WHERE YYYY IS CURRENT YEAR + 1 (ADD 1 )                             
  INREC OVERLAY=(21:DATE2,                                             
    1:C'YEAR,''',21,4,ZD,ADD,+1,EDIT=(TTTT),C'''',21:60X)             
/*                                                                     
//S2       EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                     
//SORTIN   DD DSN=INPUT FILE                               
//SORTOUT  DD DSN=OUTPUT FILE                             
//SYSIN    DD *                                           
  OPTION COPY                                             
  INCLUDE COND=(10,4,CH,LE,YEAR)                           



Gerry
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2276
Location: @my desk

PostPosted: Tue Aug 25, 2009 11:32 am    Post subject:
Reply with quote

srinivas_cog,

The same can be achieved in a single step like this.
Code:
//STEP1    EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN= Input file  (FB/180)                     
//SORTOUT  DD DSN= Output file (FB/180)                     
//SYSIN    DD *                                             
  INREC OVERLAY=(181:&DATE2,187:181,4,ZD,ADD,+1,M11,LENGTH=4)
  SORT FIELDS=COPY                                           
  OUTFIL INCLUDE=(10,4,ZD,LE,187,4,ZD),BUILD=(1,180)         
Back to top
View user's profile Send private message
srinivas_cog

New User


Joined: 05 Jun 2008
Posts: 17
Location: chennai

PostPosted: Tue Aug 25, 2009 11:59 am    Post subject: Reply to: Need to get the records which are LE to next year
Reply with quote

Thanks Gerry and Arun. Given solutions are working fine.

I used the below card

OPTION COPY
INCLUDE COND=(1,4,CH,LE,&DATE2+12)

I tested this also .. working fine.

Thanks,
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 Aug 25, 2009 7:18 pm    Post subject: Reply to: Need to get the records which are LE to next year
Reply with quote

Good to hear it is working - thanks for letting us know icon_smile.gif

d
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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