View previous topic :: View next topic
|
Author |
Message |
prakash89.gitam
New User
Joined: 30 Aug 2012 Posts: 6 Location: india
|
|
|
|
Hi....
I am writing a jcl to send a mail with attachment(attachment name should have opc date) through smtp job.
Firstly to get OPC date in attachment name i kept file name in jcl as shown below...
Code: |
//EMAIL EXEC PGM=IEBGENER,COND=(0,LT)
//SYSUT1 DD DSN=smtp.header,DISP=SHR
// DD *
FILENAME="UNEVEN_REPRT_&ODMY1..CSV"
// DD DSN=attachment.data,DISP=SHR
//SYSUT2 DD SYSOUT=(B,SMTP),DEST=GBNUHON1
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
|
If i keep this inside header , job is working fine, but attachment name has no opc date.
Code: |
FILENAME="UNEVEN_REPRT_&ODMY1..CSV"
|
So inorder to get opc date i kept this as shown above.
My header is like this
Code: |
HELO MAINFRAME.abc.com
MAIL FROM: <from__address@abc.com>
RCPT TO: <to_address@def.com>
DATA
FROM: abc
TO: <to_address@def.com>
SUBJECT: some subject
MIME-VERSION:1.0
CONTENT-TYPE:MULTIPART/MIXED;BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
mail msg
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT;
|
Now the problem is some data is getting appended to the File name. You can see that in below , i got this in spool
Code: |
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME="UNEVEN_REPRT_&ODMY1..CSV"
@abc.com>
|
From above i understood that some data is getting appended to the filename , so it is not working.... Can anyone tell me why it is getting appended... |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Quote: |
Firstly to get OPC date in attachment name i kept file name in jcl |
No, you did not. It is part of your SYSIN data. JCL begins with a // (unless it is /* - end of inline input statement. I do not recall, from reading other posts over the years if OPC will fiddle with data. I am not going to re-read as you should have done it before posting. |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
There's a few things I'm not quite clear about here.
Is the &OYMD1 variable getting resolved or not? I think you've said it is, but in the output from your spool it appears not?
If it is, then I assume that's unrelated to the issue you're getting which I think is an erroneous @abc.com> ?? |
|
Back to top |
|
|
michael baker
New User
Joined: 11 Oct 2011 Posts: 26 Location: United States of America
|
|
|
|
Apologies for my confusion here. I removed a link which was not "to a Competitor Site" which was in fact to a private individual's site with no advertising.
Michael has provided me with this in place of the link, which I will try to locate.
Bill Woodger
Quote: |
//SENDNOTE EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD *
helo MVSHOST
mail from:<MVSUser@MVSHost.xyz.com>
rcpt to:<unixuser@pop3.xyz.com>
data
From: MVSUser@MVSHost.xyz.com
To: unixuser@pop3.xyz.com
Subject: Test message from MVS using SMTP
This is a line in the body of the example note.
You will need to change:
"MVSHOST" (on the "helo MVSHOST" line) must match the JES Node name for your system as defined in your 'SYS1.PARMLIB(IEFSSNxx)' for the VMCF subsystem. If you are a JES2 site, look at any JES2 job log for the node name at the top after "N O D E".
"unixuser@pop3.xyz.com" to valid destination SMTP e-mail address
"MVSuser@MVSHost.xyz.com" to a valid TSO user and host
Note: Although you can spoof e-mail by putting anything here, your installation has the ability to go back and track when you do this. Do not use this ability to spoof e-mail and think you can't get caught! SMF records are written and with a little research, the mail spoofer will be found out.
I intentionally leave the Date: SMTP command off. When IBM's SMTP task processes your note, it will add the date and time information if not found. I've seen that if the date SMTP command was not of the right format that MS-Exchange reports the wrong time.
|
And Michael's comment:
Quote: |
I was unable to find any SMTP attatchment problems similar to what the poster is describing.... Since "abc.com is located on the "helo MVSHOST" line... my thoughts are validating that area first..... I might be wrong, but at least its a start. |
The link is, I think, here. |
|
Back to top |
|
|
prakash89.gitam
New User
Joined: 30 Aug 2012 Posts: 6 Location: india
|
|
|
|
Nic Clouston wrote: |
Quote: |
Firstly to get OPC date in attachment name i kept file name in jcl |
No, you did not. It is part of your SYSIN data. JCL begins with a // (unless it is /* - end of inline input statement. I do not recall, from reading other posts over the years if OPC will fiddle with data. I am not going to re-read as you should have done it before posting. |
Nic Clouston , By keeping file name outside i am able to get my OPC date.... so that is not a problem anymore. My problem is the data that is getting appended.
Quote: |
Is the &OYMD1 variable getting resolved or not? I think you've said it is, but in the output from your spool it appears not?
If it is, then I assume that's unrelated to the issue you're getting which I think is an erroneous @abc.com> ?? |
OPC variable is not the problem, my problem is with @abc.ocm> i am unable to know cause of the problem.. |
|
Back to top |
|
|
michael baker
New User
Joined: 11 Oct 2011 Posts: 26 Location: United States of America
|
|
|
|
(I was unable to find any SMTP attatchment problems similar to what the poster is describing.... Since "abc.com is located on the "helo MVSHOST" line... my thoughts are validating that area first..... I might be wrong, but at least its a start.)
//SENDNOTE EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD *
helo MVSHOST
mail from:<MVSUser@MVSHost.xyz.com>
rcpt to:<unixuser@pop3.xyz.com>
data
From: MVSUser@MVSHost.xyz.com
To: unixuser@pop3.xyz.com
Subject: Test message from MVS using SMTP
This is a line in the body of the example note.
You will need to change:
"MVSHOST" (on the "helo MVSHOST" line) must match the JES Node name for your system as defined in your 'SYS1.PARMLIB(IEFSSNxx)' for the VMCF subsystem. If you are a JES2 site, look at any JES2 job log for the node name at the top after "N O D E".
"unixuser@pop3.xyz.com" to valid destination SMTP e-mail address
"MVSuser@MVSHost.xyz.com" to a valid TSO user and host
Note: Although you can spoof e-mail by putting anything here, your installation has the ability to go back and track when you do this. Do not use this ability to spoof e-mail and think you can't get caught! SMF records are written and with a little research, the mail spoofer will be found out.
I intentionally leave the Date: SMTP command off. When IBM's SMTP task processes your note, it will add the date and time information if not found. I've seen that if the date SMTP command was not of the right format that MS-Exchange reports the wrong time.
The above info is derived from the below wesite:
(THIS LINK IS/WAS FOUND ON THIS WEB SITE FROM A 2004 POST BY MODERATOR SUPERK)
www.planetmvs.com/mvsmail/ |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
Back to top |
|
|
prakash89.gitam
New User
Joined: 30 Aug 2012 Posts: 6 Location: india
|
|
|
|
Hi Anuj,
I tried it as you said, but i got RC 12, my jcl is shown below.
Code: |
//MAILPROC EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP),DEST=XXXXXXXX
//SYSIN DD DUMMY
//SYSUT1 DD *
HELO MXS HOST
MAIL FROM: <from@mail.com>
RCPT TO: <to@mail.com>
DATA
FROM: From
TO: <to@mail.com>
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE:MULTIPART/MIXED;BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
mail message
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME="Report_Name_&ODMY1..CSV"
// DD DSN=dataset.name,DISP=SHR
|
In spool it is like this
Code: |
IEB311I CONFLICTING DCB PARAMETERS
IEB311I CONFLICTING DCB PARAMETERS
|
My dataset is of LRECL 56. I tried in both ways by giving "." in second dd, and without giving it. But result is same. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Please note the updates to Michael Baker's post above. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
//SYSUT1 DD *
any DD * will always be a record length of 80.
have no idea what you meant with the '.' being a problem.
but,
suggest that you change the record length of this dataset
DD DSN=dataset.name,DISP=SHR
to 80 from 56.
that is what the conflicting dcb parameters message is about. |
|
Back to top |
|
|
prakash89.gitam
New User
Joined: 30 Aug 2012 Posts: 6 Location: india
|
|
|
|
dbzTHEdinosauer wrote: |
//SYSUT1 DD *
any DD * will always be a record length of 80.
have no idea what you meant with the '.' being a problem.
but,
suggest that you change the record length of this dataset
DD DSN=dataset.name,DISP=SHR
to 80 from 56.
that is what the conflicting dcb parameters message is about. |
Thanks for the reply. BUT.
I need the name of the attachement(file) to conatin the OPC date(like filename_170912.txt). And if this syntax of attachement is kept in the dataset then OPC variable(date) is not updated and so the file name is shown as filename_&ODMY1..txt
Hence I have kept the filename outside the dataset and directly into the SYSUT1. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
The only BUT i see is the one where your head is stuck.
I said, change the record length of your file to 80 (from 56)
and it should work.
at least it will get beyond the conflicting dcb parms. |
|
Back to top |
|
|
prakash89.gitam
New User
Joined: 30 Aug 2012 Posts: 6 Location: india
|
|
|
|
dbzTHEdinosauer wrote: |
The only BUT i see is the one where your head is stuck.
I said, change the record length of your file to 80 (from 56)
and it should work.
at least it will get beyond the conflicting dcb parms. |
I am sorry I cant change that, the dataset should be of 56 record length.
any other alternative? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Create a data set with 56 record length, put this in it:
Code: |
HELO MXS HOST
MAIL FROM: <from@mail.com>
RCPT TO: <to@mail.com>
DATA
FROM: From
TO: <to@mail.com>
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE:MULTIPART/MIXED;BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
mail message
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME="Report_Name_&ODMY1..CSV"
|
and change your JCL to concatenate this data set and your other data set together.
If this doesn't appeal to you, then get used to the idea that what you want to do -- under the restrictions you keep placing on it -- cannot be done. |
|
Back to top |
|
|
prakash89.gitam
New User
Joined: 30 Aug 2012 Posts: 6 Location: india
|
|
|
|
Robert Sample wrote: |
Create a data set with 56 record length, put this in it:
Code: |
HELO MXS HOST
MAIL FROM: <from@mail.com>
RCPT TO: <to@mail.com>
DATA
FROM: From
TO: <to@mail.com>
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE:MULTIPART/MIXED;BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
mail message
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME="Report_Name_&ODMY1..CSV"
|
and change your JCL to concatenate this data set and your other data set together.
If this doesn't appeal to you, then get used to the idea that what you want to do -- under the restrictions you keep placing on it -- cannot be done. |
Hi Robert,
That dataset is being you used by some other jcls, so i said that i cant change it.
I tried by keeping this in dataset of record length 56 , but i didnt get the OPC date in the file name.
I can summarize the problem as
1) If i keep the syntax in a dataset of record length 56, OPC date is not getting updated.
2) If i dont keep it in dataset it is saying "CONFLICTING DCB PARAMETERS"
Need help in solving it.... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I think you are going to have to admit that what you want to do cannot be done, since you keep putting restrictions and raising reasons that things can't be done, rather than making the changes to make things work. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why don't you have a step to copy your 56-byte dataset to an 80-byte dataset? Easy for your Sort product or any number of other methods. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Create a copy of your 56 byte file but with an LRECL of 80. Now everything is 80. If the person at the other end want 56 then they will have to convert back. If they do not want to do that then send the file on a floppy or pen drive through the mail. You cannot mix and match 56 - or any other value not 80 - and 80 byte data in SYSIN to IEBGENER or most other programs.
Edit: page 2 strikes again so I am duplicating what Robert posted. |
|
Back to top |
|
|
|