MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to pass value(printer name) to SYSOUT=&&??

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
karupps
Beginner


Joined: 18 May 2005
Posts: 11
Topics: 3

PostPosted: Fri Oct 26, 2007 2:26 am    Post subject: How to pass value(printer name) to SYSOUT=&&?? Reply with quote

Hi,

Currently I am sending my output (from COBOL / PL1) to known printer say
...
...
...
//PRINT1 DD SYSOUT=(Q,PRT1),
// DCB=XXXX
...
...
...
But now the printer name will vary and will be taken from another flat file.

I need to take the printer name from the flat file and put in the SYSOUT in the same JCL
...
...
...
//PRINT1 DD SYSOUT=(Q,to be taken from the flat file),
// DCB=XXXX
//FILE1 DD DSN=flat file
...
...
...
Please guide me to solve the above problem.

Please let me know if you need more information

Thanks,
Karupps
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Oct 26, 2007 5:01 am    Post subject: Reply with quote

karupps,

Quote:

//PRINT1 DD SYSOUT=(Q,to be taken from the flat file),
// DCB=XXXX
//FILE1 DD DSN=flat file


Will the printer name which is coming from the flat file in a fixed position in the file?

In such a sitution I am not able to think of a JCL solution. But you can do that using REXX.
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Mon Oct 29, 2007 1:02 am    Post subject: Reply with quote

karupps,

Read your flat file through pgm, which has the printer names and pass the name thru RETURN-CODE register from the program back to the JCL. This is just a suggestion and not tried.
Back to top
View user's profile Send private message Send e-mail
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Mon Oct 29, 2007 10:11 am    Post subject: Reply with quote

If the name can exist as a PDS member in the file BEFORE your JCL is passed to the INTRDR, use JCL INCLUDE as follows:

PDS file contains a member named PRINTER with a record like:
Code:
//     SET PRTR=PRT1


add this after the JOB card:
Code:
//MYPROCS  JCLLIB ORDER=(pds.file.name)
//        INCLUDE MEMBER=PRINTER     <- pick a member/printer   


the JCL is coded like:
Code:
//SYSPRINT DD SYSOUT=(Q,&PRTR),
// DCB=???

_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
karupps
Beginner


Joined: 18 May 2005
Posts: 11
Topics: 3

PostPosted: Tue Oct 30, 2007 5:00 am    Post subject: Reply with quote

Dear all,

Thanks a lot for your suggestions!

I know the position where the printer name exists in the flat file.

For example

Record may be
<--------data 1-------><-printer name-><-----data 2------>
printer name position from 34 - 42.

If it is possible by means of REXX please let me know the high level design.

Thanks,
Karupps
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Oct 30, 2007 5:17 am    Post subject: Reply with quote

karupps,

Check the Kolusu's replies in the below link.
http://www.mvsforums.com/helpboards/viewtopic.php?t=4770&highlight=pass+value+jcl
Back to top
View user's profile Send private message Send e-mail
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Tue Oct 30, 2007 5:55 am    Post subject: Reply with quote

karupps,

Following is my suggestion:

1. Change the printer name to PRINTER_NAME in the JCL. For ex

//PRINT1 DD SYSOUT=(Q,PRINTER_NAME)

and place the JCL in a fixed location. Say "TEST.JCL(PNAME)

2. Open the datasets (Printer file in input mode and JCL in output mode) using "EXECIO"

3. Get the printer name from the printer file.
4. Replace PRINTER_NAME with the printer name in the output file. (JCL).
5. Submit the JCL via REXX using
ADDRESS TSO "SUBMIT '"JCLNAME"'"

These things can be done using a few codes of REXX. Also you just need to execute the REXX and that will inturn submit your JCL with correct printer name.


3.
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group