Need to get the batch run date in the email subject



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

Need to get the batch run date in the email subject

Postby adityapjoshi » Mon Sep 09, 2013 5:30 am

Hello All,

The Requirement is as below : I need to send a mail to a list of email ids with the following message : "Todays batch run for processing date dd/mm/yyyy is now completed."

The (dd/mm/yyyy) is a dynamic date coming from the system in a pds member aaaa.bbbbb.cccc(pdates)
The PDS member pdates contains the following set variables :

CIF01 SET CIF01='06/09/13'
CIF02 SET CIF02='01/04/13'
VTS01 SET VTS01='09.09.2013'
VTS02 SET VTS02='09/09/2013'
ZRU01 SET ZRU01='06/09/2013'
ZRU02 SET ZRU02='09/09/2013'
ZDS01 SET ZDS01='06/09/2013'
ZDS02 SET ZDS02='07/09/2013'
WGS01 SET WGS01='09/09/2013'
WOS01 SET WOS01='06/09/2013'
QZS01 SET QZS01='09/09/2013'
IKU04 SET IKU04='09/09/2013'
IKU03 SET IKU03='06/09/2013'
IKU02 SET IKU02='06.09.2013'
IKU01 SET IKU01='11.09.2013'
WOS02 SET WOS02='+0000'

The PDATES member gets updated regularly on any batch run date and will contain the processing dates in any one of the set variables.

Approach 1:

I tried to include the PDATES member in the JCL. Works fine. But when I try to set the value of the variable...for example say CIF01 in the subject line with the code &CIF01 (The way we use set variables) it does not work.the mail simply gets sent as : Todays batch run for processing date &CIF01 is now completed.

Approach 2:
I created the body of the EMAIL with the text "Todays batch run for processing date dd/mm/yyyy is now completed" and tried using the SORT OVERLAY and tried passing the CIF01 value to it dynamically....but its not working.
Example is as below :

//         SET REPL=06092013                                       
//SORTSTP2 EXEC PGM=SORT,PARM='DYNALLOC'                         
//SYSOUT   DD  SYSOUT=*                                           
//SYMNAMES DD *                                                   
DYNAM1,'&REPL'
//SORTIN   DD  DSN=XZSEWT.INPUT.FILE,DISP=SHR                     
//SORTOUT  DD  DSN=XZSEWT.INPUT.FILE.D060913,                     
//         DISP=(,CATLG,DELETE),                               
//         UNIT=SYSDA,                                             
//         SPACE=(100,(100,100),RLSE)                             
//SYSIN    DD  *                                                   
  INREC  IFTHEN=(WHEN=(27,5,CH,EQ,C'RAJEEV'),OVERLAY=(35:C'&REPL'))
        SORT FIELDS=COPY               
        OUTREC FIELDS=(1,80)   


Is there a way to pass a value to a sort card dynamically using a jcl....I tried using SYMNAMES...but its not working....The aim is to assign the date dynamically in the mail from the PDATES member file.

Could you please advise. Thank you.
adityapjoshi
 
Posts: 3
Joined: Mon Sep 09, 2013 5:01 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need to get the batch run date in the email subject

Postby NicC » Mon Sep 09, 2013 5:52 pm

Your topic has been moved to a more appropriate place.

What do you mean by "it is not working"? JCL error? Syntax error? Not the expected output?

Why would you think that SET which is for JCL symbolic replacement would work for symbolics in your data?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Need to get the batch run date in the email subject

Postby MrSpock » Mon Sep 09, 2013 8:21 pm

I also don't know what error you might be seeing. I ran a mock-up of your task:

//MYJOB JOB ....
//*
// JCLLIB ORDER=aaaa.bbbbb.cccc
//*
// INCLUDE MEMBER=pdates
//*
//STEP0001 EXEC PGM=IEFBR14,PARM='&CIF01'   


And I see the results of the variable substitution on the JESJCL output:

//STEP0001 EXEC PGM=IEFBR14,PARM='&CIF01'                     
//*                                                           
IEFC653I SUBSTITUTION JCL - PGM=IEFBR14,PARM='06/09/13'       
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Need to get the batch run date in the email subject

Postby adityapjoshi » Tue Sep 10, 2013 3:40 am

NicC wrote:Your topic has been moved to a more appropriate place.

What do you mean by "it is not working"? JCL error? Syntax error? Not the expected output?

Why would you think that SET which is for JCL symbolic replacement would work for symbolics in your data?


Thank You NicC for doing the needful. I appreciate it very much. I shall get back more convincingly.
adityapjoshi
 
Posts: 3
Joined: Mon Sep 09, 2013 5:01 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need to get the batch run date in the email subject

Postby steve-myers » Wed Sep 11, 2013 4:23 am

As NicC and MrSpock suggest, your idea of using JCL symbols won't work unless you write a program that obtains the symbols from PARM data and inserts the symbols into a data set. Something like this CLIST code which prepares control statements for another program is probably closer to what you really need.
PROC 0
CONTROL LIST
ALLOC F(SYSIN) REUS SP(1 1) TRA REC(F B) LRE(80) BLKSIZE(80)
OPENFILE SYSIN OUTPUT
SET &SYSIN = &STR(SELECT 34)
PUTFILE SYSIN
SET &SYSIN = &STR(FROM &SYS4SDATE 00:00)
PUTFILE SYSIN
CLOSFILE SYSIN
The &SYS4DATE CLIST variable creates a date like 09/10/2013, which, as it turns out, is exactly what the other program expects. I'm sure the Rexx heads out there can easily do something equivalent in Rexx.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post