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
 

 

Omit records based on the date

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

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Wed Feb 22, 2012 2:12 pm    Post subject: Omit records based on the date
Reply with quote

I have a file in that date positiion starts from 45 in the format of YYMMDD in packed decimal,now based on that date position i want to omit the records greater than 250 days.

the syntax i have used is below
SORT FIELDS=COPY
OMIT COND=(45,6,PD,GT,&DATE1P-250)

still i'm seeing some of the records in o/p..is this syntax is correct or i need add something..
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Feb 22, 2012 2:26 pm    Post subject:
Reply with quote

Which sort product are you using and what does the manual say.

One assumes it is SYNCSORT as this is posted in the JCL forum.
Back to top
View user's profile Send private message
mf_karthik

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Wed Feb 22, 2012 2:41 pm    Post subject: Reply to: Omit records based on the date
Reply with quote

Syncsort
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Wed Feb 22, 2012 4:25 pm    Post subject: Reply to: Omit records based on the date
Reply with quote

Karthik,

If the date(YYMMDD) is of PD, then the length should of 4 not 6.
Change length to 4 and check the output.


Thanks
-3nadh
Back to top
View user's profile Send private message
mf_karthik

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Wed Feb 22, 2012 8:51 pm    Post subject: Reply to: Omit records based on the date
Reply with quote

Hi,
I tried by changing the length still its not working,the sort card used

SORT FIELDS=COPY
OMIT COND=(45,4,PD,GT,&DATE1P-180).

i want to remove the records which are 180 days older.
for example date in the input:
0826
012F is 08/12/26
but its not getting omitted,in input file it declared as pic9(06) comp-3.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Feb 22, 2012 8:56 pm    Post subject:
Reply with quote

Perhaps the format is Julian date, 81226F
Back to top
View user's profile Send private message
mf_karthik

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Wed Feb 22, 2012 9:11 pm    Post subject: Reply to: Omit records based on the date
Reply with quote

No its not an julian date,in the o/p it showing as 08/12/26.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Feb 22, 2012 9:38 pm    Post subject:
Reply with quote

since
0826
012F
is a PIC S9(6) comp-3 and not PIC 9(6) comp-3

perhaps the TS is not completely computer aware.

is 45 the ordinal position or the relative location?
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Wed Feb 22, 2012 9:44 pm    Post subject: Reply to: Omit records based on the date
Reply with quote

Karthik,

Are you sure that the date value is sarting from 45th position?
Confirm the layout of the file using File-Aid. Also check whether the file is FB or VB.

Thanks
-3nadh
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Feb 22, 2012 9:57 pm    Post subject: Re: Omit records based on the date
Reply with quote

mf_karthik wrote:
I have a file in that date positiion starts from 45 in the format of YYMMDD in packed decimal,now based on that date position i want to omit the records greater than 250 days.

the syntax i have used is below
SORT FIELDS=COPY
OMIT COND=(45,6,PD,GT,&DATE1P-250)

still i'm seeing some of the records in o/p..is this syntax is correct or i need add something..

Learn the difference between LT and GT icon_razz.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Feb 22, 2012 9:58 pm    Post subject:
Reply with quote

brought to my attention

0826
012F
is a PIC 9(6) comp-3

my bad......... thx Bill..
Back to top
View user's profile Send private message
mf_karthik

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Wed Feb 22, 2012 9:59 pm    Post subject: Reply to: Omit records based on the date
Reply with quote

Hi,

yes i have checked using file manager starting position is 45 and it ends at 48 length is 4 type pd picture class 9(006) comp-3.its FB only.

and my requirement is to remove the six months old data and the date field is in pd format (yymmdd)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Feb 22, 2012 10:10 pm    Post subject:
Reply with quote

&DATE1P generates a +YYYYMMDD constant. (as per the manual)

sooooooooooooooooooooooooooooooooooooooooooooo.
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Wed Feb 22, 2012 11:53 pm    Post subject: Reply to: Omit records based on the date
Reply with quote

Karthik,

As suggested by Akatsukami, LT will give you the correct result.

Current Date - 180 will give you 20110826 (YYYYMMDD)

Here is the tested result.

Code:

 SORT FIELDS=COPY                     
 OMIT COND=(12,4,PD,LT,&DATE1P-180)   


Input File :-

Code:

FNAME      FILLER   DATE1    FILLER                                             
10/AN      1/AN     4/P      15/AN                                             
(1-10)     (11-11)  (12-15)  (16-30)                                           
1--------- 2------- 3------- 4--------------                                   
********************************* TOP OF DATA **********************-CAPS OFF-*
RECORD0               110825                                                   
RECORD1               120222                                                   
RECORD2               120201                                                   
RECORD3               100202                                                   
RECORD4                91221                                                   
RECORD5                81204                                                   
RECORD6               110826     


Output :-

Code:

FNAME      FILLER   DATE1    FILLER                             
10/AN      1/AN     4/P      15/AN                             
(1-10)     (11-11)  (12-15)  (16-30)                           
1--------- 2------- 3------- 4--------------                   
********************************* TOP OF DATA ******************
RECORD1               120222                                   
RECORD2               120201                                   
RECORD6               110826                                                               


Thanks
-3nadh
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Feb 23, 2012 3:08 am    Post subject:
Reply with quote

so even though &DATE1P resolves to 20120222,
the 4 forces a right justified 4 byte compare on x'0120222C'.

thx

but that only works for CC 20, won't work next century.
but, i won't be around to say i told you so....
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Feb 23, 2012 5:36 am    Post subject: Reply to: Omit records based on the date
Reply with quote

Easytrieve Plus does a similar type of thing with alphanumeric comparisons. Three-byte field "ABC", five-byte field, "ABCDE":
Code:

IF field-1 EQ field-2 (true)
IF field-2 EQ field-1 (false)


I know why I don't like it, so always ensure same lengths. Mostly people just aren't aware that it happens, and don't care until the user they so despise points out the problem.

I nearly PM'd -3nadh then noticed he'd tested :-)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Feb 23, 2012 9:46 am    Post subject:
Reply with quote

still say it will not work in the last century or the next.
Back to top
View user's profile Send private message
mf_karthik

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Thu Feb 23, 2012 12:38 pm    Post subject: Reply to: Omit records based on the date
Reply with quote

Its working fine after it changed to LT.

Thanks Bodatrinadh for your assistance.
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
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 How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
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