MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

change in the JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Beswar
Beginner


Joined: 04 Feb 2003
Posts: 33
Topics: 15

PostPosted: Fri Jun 03, 2005 1:26 pm    Post subject: change in the JCL Reply with quote

Hi

I have problem in changing the JCL. Currently we have library where all JCLs are stored. Many of the Jcls contain DEST=PB. This will send the reprots Pittney bose server. But we need to send the reprots only two days in a week. Other days we should not run the step that would send the reprots to Pittney bose server.

Currently we are keeping different JCLs that do not have the step that would send to Pittney bose server. But our IT management want to keep only one set of jobs for both situations and change automatically when we do not want send the reports.

I want to know what is the best way to do this automatically. I thought of writing the COBOL program that would the change the all the JCLs. Please let me know is there any simpler to way to fix the issuee

Thanks
Eswar
Back to top
View user's profile Send private message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Fri Jun 03, 2005 1:40 pm    Post subject: Reply with quote

One way would be to set it up to run or not run the step that does this based upon a condition code. You could then build a program to read a control card that would indicate whether or not the data should be sent, and set the condition code appropriately. You would then have to run this step in each job, and set up the proper condition code checking. Once this was done, you would only have to make one modification (to the parm card), and have it be effective system wide.

This could be done with a very simple COBOL program.
________
Honda CHF50 specifications


Last edited by dtf on Tue Feb 01, 2011 1:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jun 03, 2005 1:50 pm    Post subject: Reply with quote

Eswar,

Just add the following 2 steps before the step which sends the reports to pittney bose server.

The first step will unload 1 records from the db2 table which will contain the day of the week. The DAYOFWEEK function returns an integer in the range of 1 to 7 that represents the day of the week where 1 is Sunday and 7 is Saturday. And in the next step we validate this 1 record file and set with a return code. let us say you want to send the reports to PB server only monday and tuesday. So monday is 2 and tuesday is 3. So we use an include card to include only these 2 records. If the day is indeed monday or tuesady then the return code from step0200 will be 0 else it would be 4.

Now use this cond code to skip the transmission of reports using COND or IF-THEN-ELSE construct.

Code:

//STEP0100 EXEC PGM=IKJEFT01                             
//SYSTSPRT DD SYSOUT=*,DCB=BLKSIZE=121                   
//SYSPRINT DD SYSOUT=*                                   
//SYSTSIN  DD *                                         
  DSN SYSTEM(xxxx)                                       
  RUN PROGRAM(DSNTIAUL) -                               
      PLAN(DSNTIAUL)    -                               
      PARMS('SQL')      -                               
      LIB('DB2P.RUNLIB.LOAD')                           
//SYSREC00 DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSPUNCH DD DUMMY                                     
//SYSIN    DD *                                         
 SELECT DAYOFWEEK(CURRENT DATE)                         
   FROM SYSIBM.SYSDUMMY1                                 
   ;                                                     
//*                                                     
//STEP0200 EXEC PGM=SORT,PARM='NULLOUT=RC4'             
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=&T1,DISP=OLD                           
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  INCLUDE COND=(1,4,BI,EQ,2,OR,
                1,4,BI,EQ,3)
/*                                                       


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Fri Jun 03, 2005 2:07 pm    Post subject: Reply with quote

An alternative using REXX:
Code:

//STEP0100 EXEC PGM=IEBGENER                             
//SYSUT1   DD   *,DLM=@@                                 
/* REXX */                                               
EXIT DATE(B) // 7                                       
@@                                                       
//SYSUT2   DD   DSN=&T1(DOW#),DISP=(,PASS),UNIT=VIO,     
//         SPACE=(TRK,(1,1,1),RLSE)                     
//SYSPRINT DD   SYSOUT=*                                 
//SYSIN    DD   DUMMY                                   
//*                                                     
//STEP0200 EXEC PGM=IRXJCL,PARM=DOW#                     
//SYSEXEC  DD   DSN=&T1,DISP=OLD                         
//SYSTSPRT DD   SYSOUT=*                                 
//SYSTSIN  DD   DUMMY                                   
//*                                                     
Back to top
View user's profile Send private message
Beswar
Beginner


Joined: 04 Feb 2003
Posts: 33
Topics: 15

PostPosted: Fri Jun 03, 2005 3:49 pm    Post subject: Reply with quote

kolusu

I tried your two steps. But in our installation the second step is not giving return code of 4 when it is not finding a record. Please let me know any thing I need to change.

following is the JCL I submitted
Code:

//STEP0200 EXEC PGM=SORT,PARM='NULLOUT=RC4'             
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=&T1,DISP=OLD                           
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  INCLUDE COND=(1,4,BI,EQ,2,OR,
                1,4,BI,EQ,3)
/*                           

Please let me know If I need to change the JCL
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun Jun 05, 2005 8:56 pm    Post subject: Reply with quote

beswar,

Please post your sysout messages. I am guessing that you have a older version of sort. If your shop has DFSORT then you need the PTF from March 2004. If your shop has syncsort then you need syncsort 3.7 with TPF2A or higher to work for the NULLOUT parm.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Jun 06, 2005 10:15 am    Post subject: Reply with quote

Quote:
If your shop has DFSORT then you need the PTF from March 2004.


Actually, with DFSORT, you need z/OS DFSORT V1R5 to use NULLOUT. Kolusu's step works fine with z/OS DFSORT V1R5.

DFSORT R14 does not support NULLOUT. If you have DFSORT R14, you could use this DFSORT/ICETOOL step instead of the step with NULLOUT:

Code:

//STEP0200  EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN   DD DSN=&T1,DISP=OLD
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//TOOLIN DD *
  COPY FROM(IN) TO(T2) USING(CTL1)
  COUNT FROM(T2) EMPTY RC4
/*
//CTL1CNTL DD *
  INCLUDE COND=(1,4,BI,EQ,2,OR,
                1,4,BI,EQ,3)
/*


Note that you'll need the Dec, 2004 DFSORT PTF to use RC4. Without RC4, DFSORT will pass back RC=12 instead of RC=4.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Beswar
Beginner


Joined: 04 Feb 2003
Posts: 33
Topics: 15

PostPosted: Mon Jun 06, 2005 2:33 pm    Post subject: Reply with quote

Thanks you very much for your(Frank and Kolusu) replies. we didn't have DFSSOrt r14. Hence I got a return code of 12 instead of RC=4. I will try using Idcams and that might work to check the empty file.

Thanks
Eswar
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Jun 06, 2005 2:44 pm    Post subject: Reply with quote

Quote:
we didn't have DFSSOrt r14.


I assume you mean you have DFSORT R14, but you don't have the Dec, 2004 PTF.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Beswar
Beginner


Joined: 04 Feb 2003
Posts: 33
Topics: 15

PostPosted: Mon Jun 06, 2005 2:52 pm    Post subject: Reply with quote

Frank

I am sorry and you are right. we don't have the Dec ,2004 PTF


Thanks
Eswar
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jun 06, 2005 3:06 pm    Post subject: Reply with quote

beswar,

You can write a 12 line cobol pgm to set the return code .

ex:
Code:

IDENTIFICATION DIVISION.                     
PROGRAM-ID.    COBDAY                       
ENVIRONMENT DIVISION.                       
DATA DIVISION.                               
WORKING-STORAGE SECTION.                     
01 WS-DAY-OF-WEEK       PIC 9(1).           
                                             
PROCEDURE DIVISION.                         
                                             
    ACCEPT WS-DAY-OF-WEEK FROM DAY-OF-WEEK   
                                             
    IF WS-DAY-OF-WEEK = 1 OR 2               
       MOVE 4 TO RETURN-CODE                 
    END-IF                                   
                                             
    GOBACK.                                 



DAY-OF-WEEK is a single data element which represents the day of the week according to
the following values:

Code:

1 REPRESENTS MONDAY     
2 REPRESENTS TUESDAY   
3 REPRESENTS WEDNESDAY 
4 REPRESENTS THURSDAY   
5 REPRESENTS FRIDAY     
6 REPRESENTS SATURDAY   
7 REPRESENTS SUNDAY     


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group