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

SYNCSORT - OMIT FIELD for date in MM/DD/YY format


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manoopatil

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Thu Feb 26, 2009 12:46 am
Reply with quote

I need to omit records from input file where the date is older than 180 days. The date is in "MM/DD/YY" format. I understand that I could have used Y2W operand in OMIT COND clause had the date been of six character. In other words without "/" separators.

Can someone please provide a pointer to OMIT records based on the DATE value in "MM/DD/YY" format.

Following is the JCL I tried. I got the Syntax error in OMIT Clause. On removing the "(/)" after the "DATE1 parameter - The error changed to "INCLUDE/OMIT INVALID LENGTH"


Code:
//EXTRACT  EXEC PGM=SYNCSORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=TSORVS.S5R.XAUTO.PROD.CONTROL,DISP=SHR
//SORTOUT  DD DSN=TSOR.S5R.XAUTO.PROD.CONTROL,
//          UNIT=3390,
//          DISP=(,CATLG,DELETE),
//          SPACE=(CYL,(200,150),RLSE)
//SYSIN    DD  *
 SORT FIELDS=COPY
 OMIT COND=(1,3,CH,EQ,C'RPT',AND,21,8,Y2W,LT,Y'DATE1(/)'-180)
/*
//


Also the sample data is as follows

Code:

RPTAY19501      5468  52312/24/07
RPTAY19501      5471  92712/27/07
RPTAY19501      5472 108412/28/07
RPTAY19501      5474  70412/31/07
RPTAY19501      5477  91701/03/08
RPTAY19501      5478  89001/04/08
RPTAY19501      5480  77001/08/08
RPTAY19501      5481  93201/08/08


Regards
-Manohar
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Feb 26, 2009 5:08 pm
Reply with quote

manoopatil,

Check out the below example. I have modified the data to have some output records, as Current date - 180 days = 08/30/2008. Also Note the CENTWIN parameter which specifies the century window 1950-2049. You can modify it as per your requirement.
Code:
//STEP1    EXEC PGM=SORT,PARM='CENTWIN=1950'         
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                     
12/24/07                                             
12/27/07                                             
12/28/07                                             
12/31/07                                             
01/03/08                                             
01/04/08                                             
01/08/08                                             
01/08/08                                             
01/31/09                                             
08/30/08                                             
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                     
  OPTION COPY                                       
  INREC OVERLAY=(81:7,2,1,2,4,2)                     
  OUTFIL OMIT=(81,6,Y2T,LT,Y'DATE1'-180),BUILD=(1,80)

SORTOUT
Code:
01/31/09
08/30/08
Back to top
View user's profile Send private message
manoopatil

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Fri Feb 27, 2009 1:31 am
Reply with quote

Thank you very much Arun!
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top