Page 1 of 2

Need help-very new in mainframe

PostPosted: Thu Jun 03, 2010 11:48 pm
by tanaghosh
I am very new to mainframe technology. I just learned the technolgy myself and trying to start working :)
I need your help to complete my first task :)
I am having one jcl. After the job run, it sends the report to control-d.
Now I have to add one logic in jcl so that after the job run it sends the report to control-d and also to an email id.
The logic should be that the report will go to control-d and also into a dataset, and from the dataset we can send it to email id.
Can you please help me that what should be the code/syntax for this in jcl? What is the code I should add in the jcl?
Please help. Thanks in adv :)

Re: Need help-very new in mainframe

PostPosted: Fri Jun 04, 2010 1:15 am
by dick scherrer
Hello and welcome to the forum,

Suggest you post what you have, and explain what it does correctly, what has problems, and what questions you have.

You need to talk with someone on your system for the local specifics for control-d.

Re: Need help-very new in mainframe

PostPosted: Fri Jun 04, 2010 2:18 am
by Bill Dennis
I assume the report gets to Control-D based on a SYSOUT class.

To help you get started, you cannot write a report to both SYSOUT and a data set on one DD name. You'll want to create a report data set first and then go from there.

Re: Need help-very new in mainframe

PostPosted: Wed Jun 16, 2010 11:33 pm
by tanaghosh
Hi Bill,
I can write another DD to send the report to dataset right?
can you pls let me know what can be the code snippet for this?
Thanks in adv :))

Re: Need help-very new in mainframe

PostPosted: Thu Jun 17, 2010 12:05 am
by dick scherrer
Hello,

Unless i misunderstand something, you don't need "another DD".

Simply change the existing DD from sysout= to dsn= and describe the dataset to be written.

Re: Need help-very new in mainframe

PostPosted: Thu Jun 17, 2010 10:06 pm
by tanaghosh
There is already one DD which sends the job o/p to control-d.
I dont wanna affect this but just wanna send the same job o/p to dataset.
That's why I thought, I may need to write one more DD to send job o/p into dataset.
Please correct me if I'm wrong.
Thanks in adv :)

Re: Need help-very new in mainframe

PostPosted: Thu Jun 17, 2010 10:31 pm
by steve-myers
It doesn't work the way you seem to think it should work. Mr. Scherrrer is proposing that you change something that looks like -
//stpname EXEC PGM=yourpgm,...
 ... (Some JCL)
//yourDD   DD  SYSOUT=x,...
 ... (More JCL)
to something that looks something like -
//stpname EXEC PGM=yourpgm,...
 ... (Some JCL)
//yourDD   DD  DISP=(,CATLG),DSN=your-dataset,...
 ... (More JCL)
//CTLD    EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DISP=OLD,DSN=your-dataset
//SYSUT2   DD  SYSOUT=x,...
//SYSIN    DD  DUMMY
This will work most of the time, but not always. For example, in researching for a recent post to the Assembler forum I wrote a small program that did a dynamic allocation call, then called another program that listed the allocated DD statements to a DD statement that was allocated as a SYSOUT data set, then did another dynamic allocation call, then called the DD statement lister. If the output DD in the DD statement lister had been allocated to a data set rather than a JES data set, the second call to the DD statement lister would have rewritten the output data set rather than add to the data set as it did when I ran my test.

Re: Need help-very new in mainframe

PostPosted: Thu Jun 17, 2010 11:57 pm
by tanaghosh
Thanks to all for your help.. I'll try this and let u know :)

Re: Need help-very new in mainframe

PostPosted: Thu Jul 01, 2010 7:06 pm
by tanaghosh
Hi,
Now I am having job reports in dataset.
But I am having 2 reports in 2 datasets. And need to send these reports as an attachment through mail.
My question is:
1) Is it possible to attach two files in one email in single JCL. If yes how to?
2) If no, what is the other way to proceed.

FYI. I have the below codes:
STEPNAME EXEC PROC=XXXXX,..................
HEADER=AAAAAA,
MESSAGE=ABCD.TXT,
ATTACH=My DSN Name,
FILENAME=........,
DATATYPE=TEXT

So here I need to attach one more text file.

Re: Need help-very new in mainframe

PostPosted: Thu Jul 01, 2010 7:22 pm
by Robert Sample
You need to contact your site support group and work with them. The procedure you are using is not common -- it is very specific to your site and only your site. There is no way we can know exactly what is being executed therefore no way we can help you. Only your site support group has the knowledge to help.

In general, yes it is possible to send multiple attachments in an email -- assuming, of course, that your site uses standard SMTP for emails. If they use a vendor package then it may or may not be possible. Are you using a vendor package? Only your site support group can say for sure.