View previous topic :: View next topic
|
Author |
Message |
Ronny John
New User
Joined: 30 Mar 2010 Posts: 33 Location: USA
|
|
|
|
I have a requirement to send an email to client with two file names and their count as below:
To
Cc
Subj
Content:
These are the two file names
XXXXXXXX.txt RECORDS:000020300
YYYYYYYY.txt RECORDS:000030000
Regards,
XXX
I took the count names and formatted the file names using two splices
One of them is given below:
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(81,5,ZD) WITH(49,9) USING(CTL3)
/*
//CTL1CNTL DD *
INREC BUILD=(1,39,C' RECORDS:',81:SEQNUM,5,ZD)
/*
//CTL2CNTL DD *
INREC BUILD=(49:26,9,81:SEQNUM,5,ZD)
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,BUILD=(1,80)
But the issue is, when I use IEBGENER to send out the email, the second file name gets appended to the first file name. That is the email content will become
These are the two file names
XXXXXXXX.txt RECORDS:000020300YYYYYYYY.txt RECORDS:000030000
All the files have lrecl of 80 bytes. Please let me know why this happens and how to resolve it. If the data I gave are incomplete, please let me know what all you need to resolve it? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Ronny John,
I am not sure why you need splice in here. All you need is a simple copy to get the counts and use that file to send an email using IEBGENER.
Use the following DFSORT/ICETOOL JCL
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
XXXXXXXX.TXT
XXXXXXXX.TXT
XXXXXXXX.TXT
XXXXXXXX.TXT
XXXXXXXX.TXT
XXXXXXXX.TXT
//IN2 DD *
YYYYYYYY.TXT
YYYYYYYY.TXT
YYYYYYYY.TXT
//OUT DD DSN=&&OUT,DISP=(MOD,PASS,DELETE),SPACE=(TRK,(1,0),RLSE)
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL1)
//*
//CTL1CNTL DD *
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,BUILD=(80X),
TRAILER1=(1,39,' RECORDS : ',COUNT)
//*
//STEP0200 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(A,SMTP)
//SYSUT1 DD *
HELO SYSA
MAIL FROM:<blahblah@blah.com>
RCPT TO:<mehmeh@meh.COM>
DATA
FROM: <blahblah@blah.com>
TO: <mehmeh@meh.COM>
SUBJECT: Report with Counts
// DD DSN=&&OUT,DISP=(OLD,DELETE,DELETE)
// DD *
.
QUIT
//* |
|
|
Back to top |
|
|
Ronny John
New User
Joined: 30 Mar 2010 Posts: 33 Location: USA
|
|
|
|
Let me correct that.
i have to send an email with the content
"The two files have been processed
Filename1.txt records: 20000->this is teh count
Filename2.txt records: 300->this is teh count
regards,
XXX
The filenames are generated and placed in a flatfile. There is a logic to create the file name Filename1.txt and Filename2.txt is a complex process. Using IEBGENER what we did is to get the count.
The next step is the IEBGENER for sending the email.
There we face the issue, ie the file names gets appended without the line break |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Ron,
if you would just one time,
provide a decent set of requirements and descriptions,
your threads would consist of 2 posts:
1. your request
2. somebody's thought and effort which you could then turn-in at work as your solution. |
|
Back to top |
|
|
Ronny John
New User
Joined: 30 Mar 2010 Posts: 33 Location: USA
|
|
|
|
Sorry for that, never thought my initial post would make all this confusion. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Ronny John wrote: |
Let me correct that.
i have to send an email with the content |
If you have looked at the job I have shown , the only varying content is the counts part. Rest of the text is all static. So can't you change the contents of SYSUTI? to have whatever static text you want?
Did you even run the job I showed above?
Ronny John wrote: |
The filenames are generated and placed in a flatfile. There is a logic to create the file name Filename1.txt and Filename2.txt is a complex process. Using IEBGENER what we did is to get the count.
|
For some unknown reason people dig a hole too deep unnecessarily and I think this is one such instance.
I have no idea as to what your requirement is any more. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Sorry for that, never thought my initial post would make all this confusion. |
As happens here Very often, you posted something that was completely clear to you. What needed to be posted is something that would be clear to almost everyone.
When posting make sure that what you post will be understandable to people who have no knowledge of what you are trying to do - but would prefer to help.
Is it safe to say that you want to count the records in 2 files and present these counts in the e-mail?
What happens when you run the process Kolusu provided?
As Kolusu mentioned, it looks like you have made this overly complicated. . . |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
Back to top |
|
|
|