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
 

 

Is it possible to verify the date using Icetool

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Uday Kumar R

New User


Joined: 07 Nov 2007
Posts: 25
Location: Mumbai

PostPosted: Wed Sep 02, 2009 10:39 am    Post subject: Is it possible to verify the date using Icetool
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    Post subject:
Reply with quote

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

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed Sep 02, 2009 11:10 am    Post subject: Reply to: Is it possible to verify the date using Icetool
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    Post subject:
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: 25
Location: Mumbai

PostPosted: Thu Sep 03, 2009 9:08 am    Post subject:
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    Post subject:
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:

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL 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 add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am


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