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
 

 

capture system date in attachment of email send thu mainfram

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: capture system date in attachment of email send thu mainfram
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: 8593
Location: Back in jolly old England

PostPosted: Thu Dec 15, 2011 6:24 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Dec 15, 2011 6:43 pm    Post subject:
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: 7932
Location: Bellevue, IA

PostPosted: Thu Dec 15, 2011 7:17 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Dec 15, 2011 7:49 pm    Post subject:
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    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 How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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