My task is to send an email from mainframe along with an attached file in TXT format in a daily job. The requirement is such that the file name needs to be changed everyday; the name of the file is
CURRDATE_ CustomerData_SEQNUM. In this file name the value of CURRDATE and SEQNUM are coming from 2 different PDS members.
I have created a procedure NEWMAIL3 which is called from the JCL “XFIR05.TEST.MAIL(NEWMAIL2)” given below. When I submit this JCL I can send the email successfully along with the TXT file attached (the maxcc is equal to 0).
The problem is that I am not able to change the file name dynamically. The file attached in the mail is named as “&CURRDATE..CustomerData.&SEQNUM”; whereas the expected name is “30072008.CustomerData.00001”.
When I see the joblog I can see the variables are passed to the procedure along with the correct values (PGM=IKJEFT01,PARM='CURRDATE=30072008,SEQNUM=00001').
I dont think passing the Current date and Seqnum as parm would change the symbolics ( FILENAME (&CURRDATE..CustomerData.&SEQNUM)) in the control card XFIR05.TEST.MAIL(NEWPARM).
Instead u can create a flat file having all the contents of XFIR05.TEST.MAIL(NEWPARM) in the previous step which should have the symbolics replaced with the attachment name u wanted. This can be achieved via program or sort using symnames (not sure)
And then replace
//SYSTSIN DD DISP=SHR,DSN=XFIR05.TEST.MAIL(NEWPARM)
with the flat file created in the previous step.
Hope this helps. Experts correct me if i am wrong anywhere.
Joined: 14 Mar 2007 Posts: 8652 Location: Back in jolly old England
// SET CURRDATE=30072008
// SET SEQNUM=00001
Would result in a file 30072008.CustomerData.00001 - Which is an invalid MVS dataset name.
IKJEFT01 will execute what it is told to execute, and I can see nothing in your SYSTSIN code to substitute any symbolics. Just putting the required values into the PARM statement does not mean that they will automatically be substitued.
As stated by jsathishbabu84 you would probably need a prior step to resolve the symbolics and then pass a temporary file to be used as SYSTSIN.
Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
I'm looking at the XMITIP User Reference Guide page 27 where a table shows all of the Supported Symbolic Variables that are allowed for FILENAME, and I don't see either of the values you specified in the table.