View previous topic :: View next topic |
Author |
Message |
karupps Beginner

Joined: 18 May 2005 Posts: 11 Topics: 3
|
Posted: Fri Oct 26, 2007 2:26 am Post subject: How to pass value(printer name) to SYSOUT=&&?? |
|
|
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 |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Fri Oct 26, 2007 5:01 am Post subject: |
|
|
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 |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Mon Oct 29, 2007 1:02 am Post subject: |
|
|
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 |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Mon Oct 29, 2007 10:11 am Post subject: |
|
|
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:
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 |
|
 |
karupps Beginner

Joined: 18 May 2005 Posts: 11 Topics: 3
|
Posted: Tue Oct 30, 2007 5:00 am Post subject: |
|
|
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 |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Tue Oct 30, 2007 5:55 am Post subject: |
|
|
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 |
|
 |
|
|