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
 

 

EXTRRCT DAY NUMBER USING JCL

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

Active User


Joined: 05 Oct 2006
Posts: 144

PostPosted: Mon Jan 16, 2012 3:58 pm    Post subject: EXTRRCT DAY NUMBER USING JCL
Reply with quote

hi,
we have a job and It is time triggered to run on Monday and which extract data from Monday + 8 to monday+13

ex: job which runs today(2011-01-16) will extract data from (2011-01-22 to 2011-01-28).
INCLUDE=(DATE1+8 to DATE1+13),

Butif the job fails for some reason, and we can’t re-run until Tuesday. That will mean that the extract will produce records for “Tuesday” to “Sunday”
which will cause problems.

is there any way we can identify the day number and build the sort card dynamically??

say if it is day2=(DATE1-1)+8,day3=(DATE1-2)+8

please help me regarding the same.

Regds,
useit
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jan 16, 2012 4:06 pm    Post subject: Reply to: EXTRRCT DAY NUMBER USING JCL
Reply with quote

Why don't you work off a business date/data date (thanks PP)? Then you don't have a re-run problem.

In your proposed example how the would any code know that the date was the wrong one and needed adjusting?
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 144

PostPosted: Mon Jan 16, 2012 4:14 pm    Post subject:
Reply with quote

hi,
it is a weekly job and which will run every monday.

Regds,
useit.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jan 16, 2012 4:24 pm    Post subject: Reply to: EXTRRCT DAY NUMBER USING JCL
Reply with quote

Well, have a look at WEEKDAY=DIGIT1. This will return the day-of-the-week as a number, 1 to 7, for a given date format. Sunday = 1, Monday = 2, etc.

You should then be able to adjust the date range, for day 3, 4, 5, 6, 7 and 1 with some simple maths.

Remember, if you want a re-run which is more than a week out, you have to override the cards (penalty of not using a business/data date).
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Jan 16, 2012 4:25 pm    Post subject:
Reply with quote

If the job fails... why can't it be fixed and re run on the same day?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jan 16, 2012 4:28 pm    Post subject: Reply to: EXTRRCT DAY NUMBER USING JCL
Reply with quote

Job end at 23:59. or 00:01 even without failing.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Jan 16, 2012 10:34 pm    Post subject: Reply to: EXTRRCT DAY NUMBER USING JCL
Reply with quote

useit,

You can use DFSORT's NEXTDAY functions to get the desired dates. It doesn't matter what the date is . It will always gets the next sunday and the following saturday. I assumed your Lrecl=80 and recfm=fb and the date to be validated is at position 1 in the format ccyymmdd.

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
20120116 DROP                                               
20120117 DROP                                               
20120118 DROP                                               
20120119 DROP                                               
20120120 DROP                                               
20120121 DROP                                               
20120122 PICK                                               
20120123 PICK                                               
20120124 PICK                                               
20120125 PICK                                               
20120126 PICK                                               
20120127 PICK                                               
20120128 PICK                                               
20120129 DROP                                               
20120130 DROP                                               
20120131 DROP                                               
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
  OUTREC OVERLAY=(81:DATE1,X,81,8,Y4T,NEXTDSUN,TOGREG=Y4T,X,
                  90,8,Y4T,NEXTDSAT,TOGREG=Y4T)             
                                                             
  OUTFIL BUILD=(1,80),                                       
  INCLUDE=((01,8,ZD,GE,90,8,ZD),AND,(01,8,ZD,LE,99,8,ZD))   
//*
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 144

PostPosted: Tue Jan 17, 2012 10:14 am    Post subject:
Reply with quote

Thanks a lot skolosu....brilliant solution:) thanks a ton..

Regds,
useit
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 SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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