Page 1 of 1

Can we print and write to file at the same time?

Posted: Tue Dec 02, 2014 5:04 pm
by Sparsh Verma
Hi,

I have a program which is printing the report to our output class. However for a new requirement, I need to now write the same report to a file also.

The JCL is:

Code: Select all

//STE010 EXEC PGM=PGM1
//DD1 DSN=SOME.INPUT,DISP=SHR 
//REPORTP SYSOUT=P --- P is SAR class 
The program is currently writing to REPORTP. I need to write the same to a file. I have to do this in a single step. How I can do this in JCL without changing the program.

Thanks,

Re: Can we print and write to file at the same time?

Posted: Tue Dec 02, 2014 5:14 pm
by enrico-sorichetti
I have to do this in a single step. How I can do this in JCL without changing the program.
the requirement is at least stupid ...

ain any way You will have to modify something,

the program for a ONE STEP thingy

the JCL ...
the program will be left untouched
the <SYSOUT> must be changed to a dataset
a IEBGENER step must be added to print the <SYSOUT>

NOOO way to do it in ONE STEP without changing the program

Re: Can we print and write to file at the same time?

Posted: Tue Dec 02, 2014 6:07 pm
by zprogrammer
Why not add another DD and write it there?

Re: Can we print and write to file at the same time?

Posted: Wed Dec 03, 2014 4:33 am
by enrico-sorichetti
Why not add another DD and write it there?
the requirement was NOT TO CHANGE the program ( reasonably OK )

the unreasonable requirement was the addition of the ONE STEP thingy

Re: Can we print and write to file at the same time?

Posted: Wed Dec 03, 2014 6:25 am
by Robert Sample
I have to do this in a single step. How I can do this in JCL without changing the program.
These are contradictory goals and hence not likely to be both achieved. If you don't want to change the program, change the JCL to run the program a second time. If you have to do it in a single step, CHANGE THE PROGRAM! As pointed out elsewhere, attempting to put both these restrictions on your solution may very well mean you wind up with no solution at all.

Re: Can we print and write to file at the same time?

Posted: Thu May 28, 2015 8:08 pm
by Sparsh Verma
We had to chang the program. Thanks all who replied. :)

Re: Can we print and write to file at the same time?

Posted: Thu May 28, 2015 9:06 pm
by enrico-sorichetti
it would have been simpler to change the jcl,
but ... if You are happy we are happy! :mrgreen: