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

Validate the Date


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

New User


Joined: 30 Sep 2006
Posts: 14

PostPosted: Tue Sep 19, 2017 1:12 am
Reply with quote

Hello,
I'm automating one job. Before the job load/process the data I have to validate it. My input PS file should have current-1 month data. The file is with 80 LRECL and at 71 position the date is there.. for e.g 08/20/2017
I have to verify it and ensure that the data is for previous month. Once I'm done with it I can load that data.

How can I do it with ICETOOL?
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

PostPosted: Tue Sep 19, 2017 1:20 am
Reply with quote

Did you try to do something yourself (before asking others to do your job)?
Back to top
View user's profile Send private message
girishb2

New User


Joined: 30 Sep 2006
Posts: 14

PostPosted: Tue Sep 19, 2017 1:35 am
Reply with quote

yes sergeyken, I tried SORT with "DATE1" but its not working and also I dont want to reformat the data, just to validate it. Could you please help in correcting the syntax and how can I just validate it.

SORT FIELDS=COPY
INCLUDE COND=(71,10,Y4W,LT,Y'DATE1(/)'-m)
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Tue Sep 19, 2017 6:34 am
Reply with quote

What do you need to do when validation fails ?

Abend the job ?

Below is an example to compare the date.

Code:

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SYMNAMES DD *                                     
HDATE,S'&LYR4.&LMON.&DAY'                           
//SYMNOUT DD SYSOUT=*                               
//SORTIN   DD YOUR INPUT                                     
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                     
  OPTION COPY                                       
  INREC OVERLAY=(81:HDATE,                           
                 81:81,8,Y4T,SUBMONS,+1,TOGREG=Y4T, 
                 89:77,4,      $ YEAR               
                    71,2,      $ MON                 
                    74,2)      $ DAY                 
  OUTFIL INCLUDE=(89,8,CH,LT,81,8,CH),BUILD=(1,80)               

Back to top
View user's profile Send private message
girishb2

New User


Joined: 30 Sep 2006
Posts: 14

PostPosted: Tue Sep 19, 2017 6:52 am
Reply with quote

Thanks Magesh. I will test this with my file.

No, I dont want to abend the job. I just want to set Maxcc 2 and then have IF THEN condition to avoid running the subsequent steps if the validation fails.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Tue Sep 19, 2017 7:14 am
Reply with quote

I dont think maxcc 2 is possible in DFSORT.

May be you can set RC4 using DFSORT.
Back to top
View user's profile Send private message
girishb2

New User


Joined: 30 Sep 2006
Posts: 14

PostPosted: Tue Sep 19, 2017 6:42 pm
Reply with quote

I believe this will just fetch the date. I want to validate/ensure that the dataset has previous month data and once I do, I can process it.

Thats why I was trying to DATE1. I need to know the syntax for it. I will search it in DFSORT manual and If I dont find I will ask the question
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Tue Sep 19, 2017 8:53 pm
Reply with quote

Try this method and change to your positions in the data set accordingly.
And then code IF conditions to subsequent steps accordingly for rest of your JCL.
Code:
//SORTIN   DD *                                                     
H20170811                                                           
D********                                                           
D********                                                           
/*                                                                 
//OUT      DD SYSOUT=*                                             
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),                             
          OVERLAY=(41:DATE1,41:41,8,Y4T,SUBDAYS,47,2,ZD,TOGREG=Y4T))
  OUTFIL FNAMES=OUT,NULLOFL=RC4,                                   
                   INCLUDE=(1,1,CH,EQ,C'H',&,                       
                    2,6,CH,EQ,41,6,CH)                             
Back to top
View user's profile Send private message
girishb2

New User


Joined: 30 Sep 2006
Posts: 14

PostPosted: Tue Sep 19, 2017 9:29 pm
Reply with quote

My file has input data as yyyymmdd - e.g. 20170801 and I found easy way to validate. It worked.

SORT FIELDS=COPY
INCLUDE COND=(71,08,CH,LT,DATE2)
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Wed Sep 20, 2017 7:57 pm
Reply with quote

Quote:
My file has input data as yyyymmdd - e.g. 20170801 and I found easy way to validate. It worked.
have you tried the above one. its the same format , isn't it or just overlooked?
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 Date conversion using SORT SYNCSORT 4
No new posts Date Conversion Y2T to Y2W SYNCSORT 8
No new posts Date format conversion DFSORT/ICETOOL 4
No new posts Hex Value - vb file replace old date ... DFSORT/ICETOOL 14
No new posts Required Date Format in Include Sort ... DFSORT/ICETOOL 6
Search our Forums:

Back to Top