IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

capture system date in attachment of email send thu mainfram


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahul.arora

New User


Joined: 09 Jul 2011
Posts: 9
Location: India

PostPosted: Thu Dec 15, 2011 6:15 pm
Reply with quote

I am sending mail with attachment through mainframe.
I want to add system date and time in the attachment name.

Example - Current attachment name - ErrorReport.txt
Required name - ErrorReport.txt.MMDDYYYY

This is required in Batch Job which runs daily. So i can't hardcode the date.
Can anyone please provide the JCL?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Dec 15, 2011 6:24 pm
Reply with quote

So what data format is MMDDYYYY, and have you tried to open a file named as such.
Surely it should be ErrorReport.MMDDYYYY.txt

Any particular program you wish to execute to achieve this.
After all, JCL merely tells the O/S which program to execute.

Have you spoken with your support people to discuss schedular date variables
Back to top
View user's profile Send private message
rahul.arora

New User


Joined: 09 Jul 2011
Posts: 9
Location: India

PostPosted: Thu Dec 15, 2011 6:35 pm
Reply with quote

Sorry my mistake..Reuired name is ErrorReport.MMDDYYYY.txt

Can you please suggest any program or utility to achieve this.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Dec 15, 2011 6:43 pm
Reply with quote

So you need to either rename the existing input dataset, or copy it to a new name and then attach it to an email.

1) ErrorReport will be invalid
2) .MMDDYYYY. will also be invalid

So you really need to think this through before posting here unless I'm missing something
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Dec 15, 2011 7:17 pm
Reply with quote

Quote:
Can anyone please provide the JCL?
Absolutely not, because it depends at least in part upon what you have at your site. For example, if your site uses CA-7, you could set up FTP PUT command to include ErrorReport.MMDDYYYY.txt as a CARPROC and allow CA-7 to set the date each day. If you do not run CA-7 at your site, however, that would not be a viable soution. If your site runs SAS, you could use SAS to create the FTP commands with the appropriate date, then run FTP using the SAS output as your command file. If your site does not run SAS, however, that would not be a viable solution. Or you could always write a program in the language of your choice to generate the FTP commands with the appropriate date.

In other words, you need to talk to your site support group, co-workers, team leader to find out what is available AT YOUR SITE to accomplish what you want to do. Nobody on this forum works at your site, so any advice you get from here is most likely useless since it may well depend upon something not available at your site.

And note that I am assuming your name ErrorReport.MMDDYYYY.txt is what you want on the receiving site -- that name is complete nonsense on a z/OS system unless you create a Unix System Services file with that name.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Dec 15, 2011 7:49 pm
Reply with quote

Quote:
ErrorReport.MMDDYYYY.txt
Also MMDDYYYY will always be numeric - so it's not a valid node name.

If you add a "D" as a symbolic for date then node-name will be 9-character long which is again invalid, as expat has also said.

To give you a go however, this might be of some help:

Code:
//STEP00   EXEC PGM=EZACFSM1                                       
//SYSIN    DD DATA,DLM=@@                                           
//T1300ADB JOB ,'Help ',CLASS=0,MSGCLASS=1,                       
//         NOTIFY=&SYSUID,REGION=4096K                             
//STEP01   EXEC PGM=IEFBR14                                         
//SYSUT2   DD  DSN=HLQ.SLQ.D&LMON&LDAY&YR4..T&LHHMMSS,           
//             DISP=(NEW,CATLG,DELETE),                             
//             UNIT=SYSDA,RECFM=FB,LRECL=80,                       
//             SPACE=(CYL,(1,1),RLSE)                               
@@                                                                 
//SYSOUT   DD SYSOUT=(*,INTRDR),LRECL=80,BLKSIZE=80,BUFNO=1,RECFM=F
when I executed this the file generated is: HLQ.SLQ.D111215.T091359
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top