2
votes

I’m trying to replicate a case given by the book “Murach’s OS/390 and z/os JCL” (page 259), with the following code.

Briefly, I want to supply the instream dataset in the invoking job to the procedure invoked. And I have no clue why it’s not working. Have anyone any suggestion?

(I know how to make it work without the instream dataset, but I want to replicate the case in the book)

INVOKING JOB

XXXXXXX.PE000.UTILITY(SRCHCALL)

000001 //JOB1 JOB                                                              
000002 //     JCLLIB ORDER=(XXXXXXX.PE000.UTILITY)                             
000003 //STEP01 EXEC PROVA                                                     
000004 //SRCHCA1.OUT1 DD *                                                     
000005 CIAO                                                                    
000006 /*                                                                      
000007 //     

                                                             

PROCEDURE INVOKED

XXXXXXX.PE000.UTILITY(PROVA)

000001 //EXMPLE  PROC                                                          
000002 //SRCHCA1 EXEC PGM=IEFBR14                                              
000003 //OUTDD  DD DDNAME=OUT1  

                                           

JCL LISTING

 1 //JOB1 JOB                                                    
  2 //     JCLLIB ORDER=(XXXXXXXX.PE000.UTILITY)                   
  3 //STEP01 EXEC PROVA                                           
  4 XXEXMPLE  PROC                                                
  5 XXSRCHCA1 EXEC PGM=IEFBR14                                    
  6 XXOUTDD  DD DDNAME=OUT1                                       
  7 //SRCHCA1.OUT1 DD * 

                   

In the JCL listing, I was expecting to see also the string “CIAO”.

The code above is showing the exact syntax of the book, but by substituting the OUT1 in line 4 with OUTDD, I get to override line 3 of the proc only with the job’s overriding statement but not the next line (“CIAO”).

JCL LISTING (2)

5 XXSRCHCA1 EXEC PGM=IEFBR14  
6 //SRCHCA1.OUTDD DD *        
  X/OUTDD  DD DDNAME=OUT1    
1

1 Answers

3
votes

Instream data is separated from the JCL by JES2/3 when it reads and interprets the JCL stream. The actual data for each instream data set is stored separately on the JES spool space. Think of this as a temporary data set. JES "links" the DD-statement to the corresponding data. The actual data is never reproduced in the JCL listing.

You can change your procedure PROVA to look like this:

//EXMPLE   PROC                                             
//SRCHCA1  EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT1   DD DDNAME=OUT1
//SYSUT2   DD SYSOUT=*

Then rerun your first JCL and you should see the text "CIAO" in the job output. You can also run the second example, but here you will have to write:

//SRCHCA1.SYSUT1 DD *
CIAO
/*

Again, you should see "CIAO" in a separate output file ind the job output.

(Note that I have not actually run my samples.)