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
 

 

Append current time onto filename in email

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Mon Jul 25, 2011 5:33 pm    Post subject: Append current time onto filename in email
Reply with quote

Hi,

I am using the utility EZACFSM1 in my job. I have to email files with the current time appended to the filename. when i uses IEBGENER with the file name in SYSIN DD *, it seems to work fine. But i need to use a PS file.

Example of what i am using
Code:

//EMAIL   EXEC PGM=IEBGENER                                         
//SYSIN   DD DUMMY                                                   
//SYSOUT    DD SYSOUT=*                                             
//SYSPRINT  DD SYSOUT=*                                             
//SYSUT2    DD SYSOUT=(B,SMTP)                                       
//SYSUT1  DD *                                                       
HELO z/os                                                       
MAIL FROM: <XXX@zzz.com>                                         
RCPT TO: <XXX@zzz.com>                                           
DATA                                                                 
SUBJECT: Appending current time to file name
\\file link\\RPT_TIME_&LHHMMSS..TXT


What i need is
Code:

//EMAIL   EXEC PGM=IEBGENER                                         
//SYSIN   DD DUMMY                                                   
//SYSOUT    DD SYSOUT=*                                             
//SYSPRINT  DD SYSOUT=*                                             
//SYSUT2    DD SYSOUT=(B,SMTP)                                       
//SYSUT1    DD DSN=TEST.EMAIL,DISP=SHR


In TEST.EMAIL i need to have current time appended to the file name like how i had it in the SYSIN DD *. This doesnt seem to happen.
Can someone advise on this.
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: Mon Jul 25, 2011 6:08 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

Could you show how you build the contents of TEST.EMAIL so we know how you'd add the date to it?
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue Jul 26, 2011 11:48 am    Post subject: Reply to: Append current time onto filename in email
Reply with quote

This is how TEST.EMAIL looks like
Code:

HELO z/os                                                       
MAIL FROM: <XXX@zzz.com>                                         
RCPT TO: <XXX@zzz.com>                                           
DATA                                                                 
SUBJECT: Appending current time to file name
\\file link\\RPT_TIME_&LHHMMSS..TXT


Obviously this is not working as the email i receive is as below.

Appending current time to file name

\\file link\\RPT_TIME_&LHHMMSS..TXT
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Jul 26, 2011 12:16 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

Quote:
Obviously this is not working as the email i receive is as below.


Obviously Your chances of getting help are pretty slim,
You obviously forgot to post the ezacfsm1 step

but I spent a few minutes to test and it works for me

the job
Code:

 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1  JOB NOTIFY=&SYSUID,                                         
 000002 //             REGION=0M,                                               
 000003 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X                       
 000004 //*                                                                     
 000005 //EZA     EXEC PGM=EZACFSM1,REGION=0K                                   
 000006 //SYSIN     DD *                                                       
 000007 HELO z/os                                                               
 000008 MAIL FROM: <XXX@zzz.com>                                               
 000009 RCPT TO: <XXX@zzz.com>                                                 
 000010 DATA                                                                   
 000011 SUBJECT: Appending current time to file name                           
 000012 \\file link\\RPT_TIME_&LHHMMSS..TXT                                     
 000013 //SYSOUT    DD SYSOUT=*                                                 
 ****** **************************** Bottom of Data ****************************

the result ( the content of the SYSOUT DD )
Code:

********************************* TOP OF DATA **********************************
HELO z/os                                                                       
MAIL FROM: <XXX@zzz.com>                                                       
RCPT TO: <XXX@zzz.com>                                                         
DATA                                                                           
SUBJECT: Appending current time to file name                                   
\\file link\\RPT_TIME_083756.TXT                                               
******************************** BOTTOM OF DATA ********************************


the ball is on Your side of the court now icon_cool.gif
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue Jul 26, 2011 2:27 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

This is the entire JCL.

Code:

 //DDD JOB NOTIFY=&SYSUID,                                         
 //             REGION=0M,                                               
 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X                       
 //*                                                                     
//EZA     EXEC PGM=EZACFSM1,REGION=0K       
//SYSOUT DD SYSOUT=(*,INTRDR)
//SYSIN  DD DATA,DLM=@@
//CCC JOB NOTIFY=&SYSUID, MSGCLASS=U,CLASS=R
//Step1 exec proc
//
//FTPFILES EXEC PGM=IBMFTP
//Input DD *
XXXFTP.COM
CD Folder&LYYMMDD
Put 'FILE A.D&LYYMMDD..RPT'  RPT_TIME_&LHHMMSS..TXT
Quit
//*
//Email Exec PGM IEBGENER
//SYSIN   DD DUMMY                                     
//SYSOUT    DD SYSOUT=*                               
//SYSPRINT  DD SYSOUT=*                               
//SYSUT2    DD SYSOUT=(B,SMTP)                         
//SYSUT1    DD DSN=TEST.EMAIL,DISP=SHR
//*         

In TEST.EMAIL, i want to send an email that gives details of the above report with the current time attached to it. Please let me know if the requirement in not clear.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Jul 26, 2011 2:50 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

clear up the conflict between Your neurons and start posting properly
what has the FTP step You posted to do with the complaint about wrong email

the two steps You posted at run time are completely unrelated

the first step will run an FTP step with the <parameters> changed by the
EZA... process

the second step will email the content of the input without any modification!

learn to describe better Your problem
in order not to have people waste time on badly described requirements !

a quick way of sending a customized email would be just to

Code:
 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1  JOB NOTIFY=&SYSUID,                                         
 000002 //             REGION=0M,                                               
 000003 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X                       
 000004 //*                                                                     
 000005 //EZA     EXEC PGM=EZACFSM1,REGION=0K                                   
 000006 //SYSIN     DD *                                                       
 000007 HELO z/os                                                               
 000008 MAIL FROM: <XXX@zzz.com>                                               
 000009 RCPT TO: <XXX@zzz.com>                                                 
 000010 DATA                                                                   
 000011 SUBJECT: Appending current time to file name                           
 000012 \\file link\\RPT_TIME_&LHHMMSS..TXT                                     
 000013 //SYSOUT    DD SYSOUT=(B,SMTP)                                                 
 ****** **************************** Bottom of Data ****************************


for the issued debated in the first post
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue Jul 26, 2011 3:16 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

Enrico,

I posted the entire JCL because it was asked for. The 2 steps are definitely not related. the first step does an FTP. the 2nd step is for email. My requirement is to customize it no doubt.

Now the problem here is i cannot customize it in the SYSIN DD * of the JCL as it is of 80 byte LRECL. The server link with the file name goes beyond 80 byte. So i would have preferred to have it in the PS file. Is there anyway of customizing the file name with the current time in PS file? This is the question
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Jul 26, 2011 3:53 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

do You realize that You are making people waste time ???

You asked one question I replied You with a working solution for what You asked for.

what else do You want now ?

if You do not know how to describe Your own requirements
meditate a career switch to a less demanding job icon_evil.gif
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue Jul 26, 2011 4:32 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

High time for a need of a polite protocol

i am asking if it is possible to have the current time appended to a filename in a physical sequential file which will be emailed.

This question is not answered yet.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Jul 26, 2011 4:46 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

Quote:
High time for a need of a polite protocol

the politeness depends on the attitude and the willingness to cooperate of the TS
and both in this case are scarce!

under zOS dd * and sysout=* things are just treated as plain datasets
and if You do not have the basic skills of understanding it I regretfully cannot do nothing more than confirm the hint for a career shift

what did the example I posted do ???
reread and meditate icon_evil.gif

when I asked You to post the jcl I was expecting something useful, according to the initial post...
not useless garbage

and IT needs a bit of ingenuity, not just the skill to whine and complain

if You had spent 49(*) seconds to test You would have seen that EZACFSM1
works well also on VARIABLE DATASETS

(*)
10 seconds to allocate a VB datasets
4 seconds to allocate another vb dataset
8 seconds to edit the first one and cut and paste the email text from the previous example
8 seconds to correct a typo ( caps on/off issue )
12 seconds to find the jcl and change it
about 7 seconds to run the job
10 seconds to check the result

here is the job
Code:
 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1  JOB NOTIFY=&SYSUID,                                         
 000002 //             REGION=0M,                                               
 000003 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X                       
 000004 //*                                                                     
 000005 //EZA     EXEC PGM=EZACFSM1,REGION=0K                                   
 000006 //SYSIN     DD DISP=SHR,DSN=ENRICO.TEST.VB1                             
 000007 //SYSOUT    DD DISP=SHR,DSN=ENRICO.TEST.VB2                             
 ****** **************************** Bottom of Data ****************************

the input dataset
Code:
 ****** ***************************** Top of Data ******************************
 000001 HELO z/os                                                               
 000002 MAIL FROM: <XXX@zzz.com>                                               
 000003 RCPT TO: <XXX@zzz.com>                                                 
 000004 DATA                                                                   
 000005 SUBJECT: Appending current time to file name                           
 000006 \\file link\\RPT_TIME_&LHHMMSS..TXT                                     
 ****** **************************** Bottom of Data ****************************


the output dataset ( result )
Code:
 ****** ***************************** Top of Data ******************************
 000001 HELO z/os                                                               
 000002 MAIL FROM: <XXX@zzz.com>                                               
 000003 RCPT TO: <XXX@zzz.com>                                                 
 000004 DATA                                                                   
 000005 SUBJECT: Appending current time to file name                           
 000006 \\file link\\RPT_TIME_131034.TXT                                       
 ****** **************************** Bottom of Data ****************************


and here to save some of Your preciuous time a test with the substitution running after column 80

input left side
Code:
 ****** ***************************** Top of Data ******************************
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 000001 HELO z/os                                                               
 000002 MAIL FROM: <XXX@zzz.com>                                               
 000003 RCPT TO: <XXX@zzz.com>                                                 
 000004 DATA                                                                   
 000005 SUBJECT: Appending current time to file name                           
 000006 \\a very loooooooooooooooooooooooooooooooooooooooooooooooooong file link
 ****** **************************** Bottom of Data ****************************


input right side
Code:
 ****** ***************************** Top of Data ******************************
 =COLS> --+----8----+----9----+----0----+----1----+----2----+----3----+----4----
 000001                                                                         
 000002                                                                         
 000003                                                                         
 000004                                                                         
 000005                                                                         
 000006 \\RPT_TIME_&LHHMMSS..TXT                                               
 ****** **************************** Bottom of Data ****************************


output left side
Code:
  ****** ***************************** Top of Data ******************************
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 000001 HELO z/os                                                               
 000002 MAIL FROM: <XXX@zzz.com>                                               
 000003 RCPT TO: <XXX@zzz.com>                                                 
 000004 DATA                                                                   
 000005 SUBJECT: Appending current time to file name                           
 000006 \\a very loooooooooooooooooooooooooooooooooooooooooooooooooong file link
 ****** **************************** Bottom of Data ****************************


output right side
Code:
 ****** ***************************** Top of Data ******************************
 =COLS> --+----8----+----9----+----0----+----1----+----2----+----3----+----4----
 000001                                                                         
 000002                                                                         
 000003                                                                         
 000004                                                                         
 000005                                                                         
 000006 \\RPT_TIME_132429.TXT                                                   
 ****** **************************** Bottom of Data ****************************



if You are not satisfied with the level of free consultancy You get here,
You can shift to a paid for service icon_evil.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Tue Jul 26, 2011 4:56 pm    Post subject:
Reply with quote

Write a program (in the language of your choice) to generate the file name and the rest of the email commands.

Further, you are providing the requirements piecemeal -- your original post did not mention anything about needing a record length more than 80. If you are not willing to provide a complete statement of what you need, what you have tried, and where the things you tried fell short of what you need -- just how do you expect us to read your mind and provide complete solutions?

Finally, did you bother to read the manual? Section 1.2.10.1 of the Communcations Servier: IP Configuration Guide manual includes this extract:
Quote:
//STEP1 EXEC PGM=EZACFSM1,REGION=0K
//SYSIN DD DSN=TCP.DATA.INPUT,DISP=SHR
//*SYSIN DD PATH='/tmp/tcp.data.input'
| //* The input file can be either an MVS data set or an z/OS
| //* UNIX file.
//*
//*
//SYSOUT DD DSN=TCP.DATA.OUTPUT,DISP=SHR
//*SYSOUT DD PATH='/tmp/tcp.data.output',PATHOPTS=(OWRONLY,OCREAT),
//* PATHMODE=(SIRUSR,SIWUSR,SIRGRP,SIWGRP)
| //* The output file can be either an MVS data set or an z/OS
| //* UNIX file.
//*
//* The output file cannot be the same file as the input file-
//* doing so will result in a return code of 45.
//*
//* You can mix input and output file types (i.e., the input
| //* can be an MVS data set with the output being a z/OS UNIX
| //* file or visa versa).
//* Note: Other pathmodes for sysout may be used if needed.
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue Jul 26, 2011 5:13 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

thanks Robert for a humane reply.
My only question was if it was possible to customize the filename in the Physical sequential file through some method.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Jul 26, 2011 5:16 pm    Post subject: Reply to: Append current time onto filename in email
Reply with quote

thank You for the great opportunity You gave me to waste time on writing snippets testing them posting them and trying to explain them to You icon_evil.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Tue Jul 26, 2011 5:27 pm    Post subject:
Reply with quote

Since you do not seem to be interested in actually trying any of the posted solutions, and keep asking the same thing over and over -- I'm locking this topic. Either go try enrico's suggestions, or try SOMETHING on your own, but stop wasting our time by asking and asking and asking without giving us any idea as to what problem you are having.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
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. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
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 cics & real time monitoring icehat CICS 5 Wed Sep 07, 2016 2:29 am


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