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

Skip records having a field value 13 months less than today


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

New User


Joined: 10 Jul 2008
Posts: 14
Location: Chennai

PostPosted: Mon Aug 25, 2008 11:46 am
Reply with quote

I've a File with around 300,000 records in it. I need to skip all records which has effective date value 13 months earlier to current date.
The effective date starts from 16th byte in the file and has a length of 6 bytes, It is in MMDDYY format


Ezhil
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Aug 25, 2008 2:37 pm
Reply with quote

you should use
Code:

  OMIT COND=(16,6,ZD,LE,Y'DATE1'-360)


for more see
[url]
Use [URL] BBCode for External Links
[/url]
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Aug 25, 2008 8:17 pm
Reply with quote

Hello Ezhil,

Which sort product is used on your system (probably DFSORT or Syncsort)?

If you are not sure, the product information is at the top of the information created when a sort is run.

Knowing which sort product is used to determine which part of the forum supports your question.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 25, 2008 9:36 pm
Reply with quote

Quote:

OMIT COND=(16,6,ZD,LE,Y'DATE1'-360)


This OMIT statement is invalid. A Y-constant cannot be used with ZD format - it can only be used with Y2x format. This would be valid:

Code:

  OMIT COND=(16,6,Y2W,LE,Y'DATE1'-360)


And you'd need to set the century window correctly (Y2PAST option).

However, 30 * 13 is NOT really equivalent to 13 months since not every month has 30 days. Starting at a particular day of a month (e.g. August 25th, 2008) and going back 13 months is more subtle than subtracting 360 days unless a rough approximation is good enough.
Back to top
View user's profile Send private message
Ezhil Murugan

New User


Joined: 10 Jul 2008
Posts: 14
Location: Chennai

PostPosted: Tue Aug 26, 2008 8:58 am
Reply with quote

I get the error message - DSS10080E VALUE 'Y'DATE1'-360' SHOULD HAVE BEEN A VALID SORT CONSTANT' when I try to use the above OMIT . Please help
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Aug 26, 2008 10:02 am
Reply with quote

Quote:
DSS10080E


Which SORT product are you using!!!!

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

New User


Joined: 10 Jul 2008
Posts: 14
Location: Chennai

PostPosted: Tue Aug 26, 2008 10:34 am
Reply with quote

I think it's DFSORT, I could see the following displays in one of my SORT jobs in the SPOOL


1ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED

ICE250I 0 VISIT www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE

ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 11:39 ON FRI AUG 22, 2008

-0 SORT FIELDS=COPY
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Aug 26, 2008 10:41 am
Reply with quote

Hello,

Please post the jcl, sort control statements, and the jes output presented by the sort execution.
Back to top
View user's profile Send private message
Ezhil Murugan

New User


Joined: 10 Jul 2008
Posts: 14
Location: Chennai

PostPosted: Tue Aug 26, 2008 11:51 am
Reply with quote

Hi Sch,
I got that error message when I did a job scan. But the job went fine when I submitted it. Not sure why it is so.. Thanks for all your help. I got the expected results and what I need to do if the date in the file is in YYMMDD format?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Aug 26, 2008 12:48 pm
Reply with quote

Quote:
got that error message when I did a job scan. But the job went fine when I submitted it. Not sure why it is so


because job scanners are seldom in sync with the current syntax for dsfsort and syncsort
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top