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

Select record based on Date with condtion


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Thu Jul 23, 2009 11:24 pm
Reply with quote

I have a requirement like below, can any one help me,

I have a VSAM(KSDS) file like below, LRECL = 550

SE1879909277768296200907241150P086690.... .
SE1879909277768296200907241150P086691.... .
SE1879909277768296200907241150P086692.... Y
SE1979909277956094311502009072319911366.. .
SE1979909277956094311502009072319915878..Y

1. If byte from 1 to 4 is equal to SE18 and bytes from 19 to 26 is greater than (current date - 7).
(OR)
2. If byte from 1 to 4 is equal to SE19 and byte from 24 to 31 is greater
than (current date - 7).
(OR)
3. If byte 42 is not equal to Y.

If above any one of the condition is satisfied for a record then needs to write that record into file1.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jul 24, 2009 12:04 am
Reply with quote

senthilkumar,

Use the following DFSORT control cards

Code:

//SYSIN    DD *                                                 
  SORT FIELDS=COPY   
  RECORD TYPE=F                                           
  INCLUDE COND=((01,4,CH,EQ,C'SE18',AND,19,8,CH,GT,DATE1-7),OR, 
                (01,4,CH,EQ,C'SE19',AND,24,8,CH,GT,DATE1-7),OR, 
                 42,1,CH,EQ,C'Y')                               
/*
Back to top
View user's profile Send private message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Sun Jul 26, 2009 1:40 am
Reply with quote

HI Skolusu,
Thanks for your code. It worked fine as I expected.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top