Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Validate the Date

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

New User


Joined: 30 Sep 2006
Posts: 13

PostPosted: Tue Sep 19, 2017 1:12 am    Post subject: Validate the Date
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 User


Joined: 29 Apr 2008
Posts: 229
Location: Maryland

PostPosted: Tue Sep 19, 2017 1:20 am    Post subject:
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: 13

PostPosted: Tue Sep 19, 2017 1:35 am    Post subject: Reply to: Validate the Date
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: 211
Location: Chennai

PostPosted: Tue Sep 19, 2017 6:34 am    Post subject: Reply to: Validate the Date
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: 13

PostPosted: Tue Sep 19, 2017 6:52 am    Post subject:
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: 211
Location: Chennai

PostPosted: Tue Sep 19, 2017 7:14 am    Post subject:
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: 13

PostPosted: Tue Sep 19, 2017 6:42 pm    Post subject: Reply to: Validate the Date
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

Senior Member


Joined: 21 Sep 2010
Posts: 1827
Location: NY,USA

PostPosted: Tue Sep 19, 2017 8:53 pm    Post subject:
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: 13

PostPosted: Tue Sep 19, 2017 9:29 pm    Post subject: Reply to: Validate the Date
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

Senior Member


Joined: 21 Sep 2010
Posts: 1827
Location: NY,USA

PostPosted: Wed Sep 20, 2017 7:57 pm    Post subject:
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    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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us