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

Is it possible to verify the date using Icetool


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Uday Kumar R

New User


Joined: 07 Nov 2007
Posts: 27
Location: Mumbai

PostPosted: Wed Sep 02, 2009 10:39 am
Reply with quote

Hi,

I have file with LRECL=25 (files is of big size aroung 40Million lines). out of these 25 coloumns first 5 digits give a number. the next 10 coloumns represent the date. rest is about some other information. Is it possible to verify the date present in the file is correct or not? for example..

File:
1111104/28/2009xxxxxxxx
1111102/30/2009xxxxxxxx
2222209/20/2009xxxxxxxx
2222208/20/2009xxxxxxxx
2222210/21/2009xxxxxxxx

now what i am looing is i need to check if the date parameter from 15-25th position is wrong (like 2nd entry) then i need move all entries into a new file whose value at 1-5 position are equall.

So my output would be:
File1:
1111104/28/2009xxxxxxxx
1111102/30/2009xxxxxxxx

File2:
2222209/20/2009xxxxxxxx
2222208/20/2009xxxxxxxx
2222210/21/2009xxxxxxxx

Any idea is it possible to perfrom this task thru Fileaid or sort utilities?
Thank you for any suggestion on this.

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

Senior Member


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

PostPosted: Wed Sep 02, 2009 10:57 am
Reply with quote

Refer below.. You might need minor changes based upon your date format.

www.ibmmainframes.com/viewtopic.php?t=38159&highlight=validate+date
www.ibmmainframes.com/viewtopic.php?t=43209&highlight=validate+date
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 02, 2009 11:10 am
Reply with quote

the second link refers to a db2 environment icon_biggrin.gif
The TS asked about a ICETOOL/DFSORT solution

the link posted satisfies only partially the requirement...
if I understand correctly
the TS wants to <discard> all the records with the same key if any one of them has a wrong date
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Sep 03, 2009 12:12 am
Reply with quote

Uday kumar,

The following DFSORT JCL will give you the desired results


Code:

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=Your input fb 25 byte file,DISP=SHR
//VALID    DD SYSOUT=*                                             
//INVALID  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(26:6,10,UFF,EDIT=(TTTTTTTT))),   
  IFTHEN=(WHEN=INIT,OVERLAY=(35:30,4,ZD,MOD,+4,EDIT=(T),           
                             36:30,4,ZD,MOD,+100,EDIT=(TTT),       
                             39:30,4,ZD,MOD,+400,EDIT=(TTT),       
                             43:C'V')),                             
                                                                   
  IFTHEN=(WHEN=(39,3,ZD,EQ,0,OR,(35,1,ZD,EQ,0,AND,36,3,ZD,GT,0)),   
  OVERLAY=(42:C'L'),HIT=NEXT),                                     
                                                                   
  IFTHEN=(WHEN=(26,2,ZD,EQ,0,OR,28,2,ZD,EQ,0,OR,30,04,ZD,EQ,0),     
  OVERLAY=(43:C'I'),HIT=NEXT),                                     
                                                                   
  IFTHEN=(WHEN=(26,2,ZD,GT,12),OVERLAY=(43:C'I'),HIT=NEXT),         
                                                                   
  IFTHEN=(WHEN=(26,02,ZD,EQ,01,AND,28,02,ZD,GT,31),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                     
                                                                   
  IFTHEN=(WHEN=(42,1,CH,EQ,C' ',AND,26,02,ZD,EQ,02,AND,             
  028,02,ZD,GT,28),OVERLAY=(43:C'I'),HIT=NEXT),                     
                                                                   
  IFTHEN=(WHEN=(42,1,CH,EQ,C'L',AND,26,02,ZD,EQ,02,AND,             
  028,02,ZD,GT,29),OVERLAY=(43:C'I'),HIT=NEXT),                     
                                                                   
  IFTHEN=(WHEN=(26,02,ZD,EQ,03,AND,28,02,ZD,GT,31),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                     
                                                                   
  IFTHEN=(WHEN=(26,02,ZD,EQ,04,AND,28,02,ZD,GT,30),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                     
                                                                   
  IFTHEN=(WHEN=(26,02,ZD,EQ,05,AND,28,02,ZD,GT,31),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                     
                                                                   
  IFTHEN=(WHEN=(26,02,ZD,EQ,06,AND,28,02,ZD,GT,30),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                     
                                                                   
  IFTHEN=(WHEN=(26,02,ZD,EQ,07,AND,28,02,ZD,GT,31),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                     
                                                                   
  IFTHEN=(WHEN=(26,02,ZD,EQ,08,AND,28,02,ZD,GT,31),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                       
                                                                     
  IFTHEN=(WHEN=(26,02,ZD,EQ,09,AND,28,02,ZD,GT,30),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                       
                                                                     
  IFTHEN=(WHEN=(26,02,ZD,EQ,10,AND,28,02,ZD,GT,31),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                       
                                                                     
  IFTHEN=(WHEN=(26,02,ZD,EQ,11,AND,28,02,ZD,GT,30),                 
  OVERLAY=(43:C'I'),HIT=NEXT),                                       
                                                                     
  IFTHEN=(WHEN=(26,02,ZD,EQ,12,AND,28,02,ZD,GT,31),                 
  OVERLAY=(43:C'I'),HIT=NEXT)                                       
                                                                     
  SORT FIELDS=(1,5,CH,A,43,1,CH,A),EQUALS                           
                                                                     
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(45:SEQNUM,8,ZD,RESTART=(1,5))), 
  IFTHEN=(WHEN=GROUP,BEGIN=(45,8,ZD,EQ,1),PUSH=(44:43,1))           
                                                                     
  OUTFIL FNAMES=INVALID,INCLUDE=(43,2,SS,EQ,C'I'),BUILD=(1,25)       
  OUTFIL FNAMES=VALID,SAVE,BUILD=(1,25)                             
/*
Back to top
View user's profile Send private message
Uday Kumar R

New User


Joined: 07 Nov 2007
Posts: 27
Location: Mumbai

PostPosted: Thu Sep 03, 2009 9:08 am
Reply with quote

Hi all,

Thanks for all your valuable suggestion and explanations for my request and your time.

Thanks,
Uday
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Nov 17, 2009 5:16 am
Reply with quote

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707, you can use the new date conversion functions to validate a date like shown below to get the desired results

Code:

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=Your input fb 25 byte file,DISP=SHR
//VALID    DD SYSOUT=*                                             
//INVALID  DD SYSOUT=*
//SYSIN    DD *                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(26:6,10,UFF,EDIT=(TTTTTTTT))), 
  IFTHEN=(WHEN=INIT,OVERLAY=(34:26,8,Y4W,TOJUL=Y4W))               
  SORT FIELDS=(1,5,CH,A,34,1,CH,A),EQUALS                         
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(41:SEQNUM,8,ZD,RESTART=(1,5))),
  IFTHEN=(WHEN=GROUP,BEGIN=(41,8,ZD,EQ,1),PUSH=(34:34,1))         
  OUTFIL FNAMES=INVALID,INCLUDE=(34,1,CH,EQ,C'*'),BUILD=(1,25)     
  OUTFIL FNAMES=VALID,SAVE,BUILD=(1,25)                           
//*



For complete details on date conversion functions and the other new functions available with the Nov, 2009 DFSORT PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
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 ICETOOL returns no records JCL & VSAM 1
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top