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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT - OMIT FIELD for date in MM/DD/YY format
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: 2237
Location: @my desk

PostPosted: Thu Feb 26, 2009 5:08 pm    Post subject:
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    Post subject:
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    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 How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


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