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

Append current time onto filename in email


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   This topic is locked: you cannot edit posts or make replies.
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
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

Global Moderator


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

PostPosted: Mon Jul 25, 2011 6:08 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jul 26, 2011 12:16 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jul 26, 2011 2:50 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jul 26, 2011 3:53 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jul 26, 2011 4:46 pm
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: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 26, 2011 4:56 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jul 26, 2011 5:16 pm
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: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 26, 2011 5:27 pm
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. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Email attachment from mainframe is empty PC Guides & IT News 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Changeman - how can we know the curr... Compuware & Other Tools 2
Search our Forums:

Back to Top