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
 

 

Changing the name of the email attachment dynamically.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Wed Aug 20, 2008 12:44 pm    Post subject: Changing the name of the email attachment dynamically.
Reply with quote

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').

Can anyone please help me out with this problem?

JCL - XFIR05.TEST.MAIL(NEWMAIL2)
Code:
//XFIR05AJ JOB CLASS=I,MSGCLASS=X,REGION=0M,NOTIFY=&SYSUID   
//JOBLIB   DD DSN=ALC.PROD.BLOAD,DISP=SHR                   
//         DD   DSN=TEL.PROD.LOADLIB.BATCH,DISP=SHR         
//PROCLIB  JCLLIB ORDER=(TEL.TEST.DATA.FEED.FILE.PARMS)     
//STEP0001 INCLUDE MEMBER=CURRDATE                           
//STEP0002 INCLUDE MEMBER=SEQNUM                             
//STEP0003 EXEC NEWMAIL3,                                   
//           CURRDATE=&CURRDATE,                             
//           SEQNUM=&SEQNUM                                 
//*



VALUE OF CURRDATE - TEL.TEST.DATA.FEED.FILE.PARMS(CURRDATE)
Code:
// SET CURRDATE=30072008


VALUE OF SEQNUM - TEL.TEST.DATA.FEED.FILE.PARMS(SEQNUM)
Code:
// SET SEQNUM=00001


PROC - TEL.TEST.DATA.FEED.FILE.PARMS(NEWMAIL3)
Code:
//NEWMAIL3 PROC                                                       
//PRST001  EXEC PGM=IKJEFT01,PARM='CURRDATE=&CURRDATE,SEQNUM=&SEQNUM'
//SYSPROC   DD DISP=SHR,DSN=SYS3.SPF.PROCS                           
//          DD DISP=SHR,DSN=ALC.PROD.PARMLIB                         
//ISPPROF   DD UNIT=SYSDA,                                           
//             SPACE=(TRK,(2,1,2),RLSE),                             
//             LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PO                   
//ISPLOG    DD UNIT=SYSDA,                                           
//             SPACE=(TRK,(2,1,2),RLSE),                             
//             LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PO                   
//*********                                                           
//TEXT      DD DISP=SHR,DSN=TEL.TEST.DATA.FEED.MAIL(-1)               
//*********                                                           
//SYSTSPRT  DD SYSOUT=*                                               
//SYSPRINT  DD SYSOUT=*                                               
//SYSOUT    DD SYSOUT=*                                               
//SYSTSIN   DD DISP=SHR,DSN=XFIR05.TEST.MAIL(NEWPARM)                 
//*


EMAIL PARAMETERS - XFIR05.TEST.MAIL(NEWPARM)
Code:
 XMITIP (abc.def@xyz.com                      -
 Pqr.lmn@xyz.com)                         +   
 MSGDS 'xfir05.test.mail(DECLARE1)'       +   
 FORMAT TXT                               +   
 FROM hij.klm@xyz.com                     +   
 SUBJECT 'Mailing Data Feed File.'        +   
 IMPORTANCE NORMAL                        +   
 PRIORITY NORMAL                          +   
 FILEDD (TEXT)                            +   
 FILENAME (&CURRDATE..CustomerData.&SEQNUM)
Back to top
View user's profile Send private message

jsathishbabu84

New User


Joined: 07 Jun 2007
Posts: 22
Location: India

PostPosted: Wed Aug 20, 2008 5:17 pm    Post subject:
Reply with quote

Hi Shanu,

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.

Regards,
SJ
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 20, 2008 5:39 pm    Post subject:
Reply with quote

// SET CURRDATE=30072008
// SET SEQNUM=00001
FILENAME (&CURRDATE..CustomerData.&SEQNUM)

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.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Aug 20, 2008 5:44 pm    Post subject: Reply to: Changing the name of the email attachment dynamica
Reply with quote

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.
Back to top
View user's profile Send private message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Thu Aug 21, 2008 9:22 pm    Post subject: Reply to: Changing the name of the email attachment dynamica
Reply with quote

Thanx.. had to write a new program which will create the NEWPARM. Now I am able to name the file dynamically.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm
No new posts changing z/os unicode conversion service meykh2014 All Other Mainframe Topics 0 Tue Jul 12, 2016 10:49 am
No new posts How to send email with Rich Text usin... santhosh5983 JCL & VSAM 4 Fri Apr 08, 2016 2:30 am


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