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

JES2/3, JCL, utilities.
Post Reply
Sparsh Verma
New Member
Posts: 7
Joined: Mon Apr 28, 2014 9:31 am

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

Post 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,
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

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

Post 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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

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

Post by zprogrammer »

Why not add another DD and write it there?
zprogrammer
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

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

Post 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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1892
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

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

Post 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.
Sparsh Verma
New Member
Posts: 7
Joined: Mon Apr 28, 2014 9:31 am

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

Post by Sparsh Verma »

We had to chang the program. Thanks all who replied. :)
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

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

Post by enrico-sorichetti »

it would have been simpler to change the jcl,
but ... if You are happy we are happy! :mrgreen:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”