Hal
2011-05-19 00:07:27 UTC
Hi All...
I'm not a real good programmer so I'm gonna do my best to explain, and
hope someone more knowledgeable than myself knows how to fix this
problem. I wrote a *CMD, an SQL stored procedure, and a CL program to
allow a couple users to pull information out of a couple payroll files
and then receive an email with the results of the program in their
inbox.
The *CMD collects one parameter, an integer number.
The CL program declares the parm from the *CMD, and runs the stored
procedure.
The stored procedure empties out my target 'work' table, selects
various columns from a number of tables based on the integer number
passed in, and strings all the columns together into one big column,
and writes the result set to the previously emptied table.
I then use CPYTOPCD to copy the LIBRARY/FILE(MEMBER) that the stored
procedure just updated to a folder/document combo in QDLS.
Finally, I use SNDDST to email out the file.
The users get the email, and its 99% perfect...but the problem is this
pesky EOF character that CPYTOPCD sticks on the end of the file.
I tried playing with the TRNFMT parameter, changing it to *NOTEXT.
This had the unwanted side effect of removing the carriage return/
linefeed from each row of data in the table, -and- the EOF character
from the file placed in QDLS.
I need one of two things to happen...I need to suppress the EOF
character and leave *TEXT in place for the TRNFMT parameter, or I need
to specify *NOTEXT and somehow add the CR/LF combo myself to the end
of each record, and I assume I would want to do this inside the stored
procedure so the necessary information is in the database table at the
time I execute the CPYTOPCD.
Any experts have a suggestion/pointer for me? I've searched a few
forums/sites and I found a few suggestions regarding adding a X'0D' to
the records in the table, but so far I can't figure out how to do
that?
Thanks,
I'm not a real good programmer so I'm gonna do my best to explain, and
hope someone more knowledgeable than myself knows how to fix this
problem. I wrote a *CMD, an SQL stored procedure, and a CL program to
allow a couple users to pull information out of a couple payroll files
and then receive an email with the results of the program in their
inbox.
The *CMD collects one parameter, an integer number.
The CL program declares the parm from the *CMD, and runs the stored
procedure.
The stored procedure empties out my target 'work' table, selects
various columns from a number of tables based on the integer number
passed in, and strings all the columns together into one big column,
and writes the result set to the previously emptied table.
I then use CPYTOPCD to copy the LIBRARY/FILE(MEMBER) that the stored
procedure just updated to a folder/document combo in QDLS.
Finally, I use SNDDST to email out the file.
The users get the email, and its 99% perfect...but the problem is this
pesky EOF character that CPYTOPCD sticks on the end of the file.
I tried playing with the TRNFMT parameter, changing it to *NOTEXT.
This had the unwanted side effect of removing the carriage return/
linefeed from each row of data in the table, -and- the EOF character
from the file placed in QDLS.
I need one of two things to happen...I need to suppress the EOF
character and leave *TEXT in place for the TRNFMT parameter, or I need
to specify *NOTEXT and somehow add the CR/LF combo myself to the end
of each record, and I assume I would want to do this inside the stored
procedure so the necessary information is in the database table at the
time I execute the CPYTOPCD.
Any experts have a suggestion/pointer for me? I've searched a few
forums/sites and I found a few suggestions regarding adding a X'0D' to
the records in the table, but so far I can't figure out how to do
that?
Thanks,