Can't submit job to internal reader



High Level Assembler(HLASM) for MVS & VM & VSE

Can't submit job to internal reader

Postby chong_zhou » Fri Dec 21, 2018 6:19 am

For some reason, I need to submit job from my programme (written in HLASM). Here is how I did it (simplified a lil bit):

* OPEN INTERNAL READER AS OUTPUT FILE
OPENRDR  DS    0H
         WTO   'OPENING INTERNAL READER'
         OPEN  (WRKACB,(OUTPUT)),MF=(E,WRKOPEN)
         LTR   R2,R15
         BZ    WRITERDR
         WTO   'OPEN FAILED'

WRITERDR DS    0H
         WTO   'WRITING INTERNAL READER'
         LA    R3,JCLLINES
WRLOOP   DS    0H
         WTO   MF=(E,(3))               ECHO BEFORE WRITE OUT
         LA    R2,4                     SKIP WTO HEADER
         AR    R3,R2
         CLC   0(1,R3),=C'*'            IS THE EOF LINE?
         BZ    CLOSERDR                 YES: EXIT LOOP
         MVC   WRKJCREC,0(R3)           NO:  WRITE TO OUTPUT REC
         LA    R2,80                    GO TO NEXT LINE
         AR    R3,R2
         PUT   RPL=WRKRPL               OUTPUT REC TO INTERNAL READER
         LTR   R2,R15                   WORKED?
         BZ    WRLOOP                   YES: CONTINUE LOOP
         WTO   'PUT FAILED'             NO:  LOG ERROR MESSAGE

* CLOSE INTERNAL READER
CLOSERDR DS    0H
         WTO   'CLOSING INTERNAL READER'
         CLOSE WRKACB,MF=(E,WRKCLOSE)
 


But it is not working:no new job was seen in SDSF and the following error message was found in JESMSGLG:


+//ZHOUTEST JOB 127300030,ZHOCH02,CLASS=A,REGION=0M
+//STEP1    EXEC PGM=IEFBR14
$HASP125 LNGRDR   INTRDR     SKIPPING FOR JOB CARD FROM JOB18853 LNGRDR
+//STEP2    EXEC PGM=IEFBR14
 

(See the 3rd line in the log)

The JCL that my programme tried to submit only has 3 lines (for test purpose) as seen in the above log. But the '$HASP125' message said the JCL was rejected.

I tried the following things:

1. Copied the 3 lines of test JCL to a normal dataset and manually 'sub' it, it worked fine.
2. I made my programme's load module dataset authorized.

But nothing worked for me so far. Is there anything I did wrong? or did I omitted anything? For example, do I have to 'sign on' a user in my programme before opening the internal reader? (nobody mentioned this on the internet)

Thank you very much!
chong_zhou
 
Posts: 38
Joined: Wed Nov 01, 2017 8:59 pm
Has thanked: 21 times
Been thanked: 0 time

Re: Can't submit job to internal reader

Postby steve-myers » Fri Dec 21, 2018 7:19 am

I have submitted jobs using the ACB/RPL interface before. Yes, it really does work, though it has been a long time. Instead of telling us it doesn't work, you did not tell us the contents of your ACB and RPL. What are the contents of the ACB and RPL? No one can help you without that information.

Why are you using this interface? What do you hope to gain? The only potential advantage I know of other than a tiny advantage of using less CPU time is to obtain the job id of the submitted job, which you are not doing.
steve-myers
Global moderator
 
Posts: 2086
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 235 times

Re: Can't submit job to internal reader

Postby chong_zhou » Fri Dec 21, 2018 7:38 am

Hi steve-myers, thank you for your quick reply! Yes, the purpose is exactly to get job id after submission. The code that I posted doesn't do that because it is a slightly simplified version.

Here is the ACB and RPL that were omitted in the above simplified version:


$RDRACB  ACB   DDNAME=MYRDR,MACRF=(ADR,SEQ,OUT)
$RDRRPL  RPL   AREALEN=80,OPTCD=(ADR,SEQ,SYN,NUP),RECLEN=80,
               ACB=*-*,AREA=*-*
 


Among which, the ddname 'MYRDR' is defined in the executing JCL of my test programme:

//MYRDR   DD  SYSOUT=(A,INTRDR)


The problem is that the return codes of OPEN, PUT, CLOSE are all 0s, but I didn't see any new job submitted, and I got the '$HASP125...INTRDR SKIPPING FOR JOB CARD FROM...' error message.

Thank you again.
chong_zhou
 
Posts: 38
Joined: Wed Nov 01, 2017 8:59 pm
Has thanked: 21 times
Been thanked: 0 time

Re: Can't submit job to internal reader

Postby steve-myers » Fri Dec 21, 2018 9:11 am

First, I think your ACB is OK.

Second, unless there is missing code, your RPL does not point to the ACB. For sure, your RPLAREA does not point to your record. Other than that, I think your RPL is OK.

Third, I do not see any code to retrieve the job ID. It is not as simple as you might think. As far as I can tell, the JES Application Programming manual does not talk about the traditional mechanism to retrieve the job ID, though it does discuss setting up the ACB and RPL, and how to allocate the internal reader, both with JCL and with dynamic allocation. JES Application Programming does describe a feed back mechanism to obtain the job ID, but that needs z/OS 2.2 and later and a lot more code. If your input data contains multiple jobs, you have to analyze the input to get the job ID for each job. This in non trivial.
steve-myers
Global moderator
 
Posts: 2086
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 235 times

Re: Can't submit job to internal reader

Postby expat » Fri Dec 21, 2018 1:44 pm

Has the option of submitting jobs via the INTRDR been restricted by your security people.
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Can't submit job to internal reader

Postby steve-myers » Fri Dec 21, 2018 4:16 pm

expat wrote:Has the option of submitting jobs via the INTRDR been restricted by your security people.

No, that's not the issue. The ACB/RPL interface writes to an internal reader, just like the DCB interface. Ultimately the DCB PUT macro creates and uses PUT RPL= to send data to JES whether to the internal reader or a regular SYSOUT data set.
steve-myers
Global moderator
 
Posts: 2086
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 235 times

Re: Can't submit job to internal reader

Postby chong_zhou » Fri Dec 21, 2018 5:30 pm

Hi Steve, thank you so much for your kind following up!! Really appreciated!!

Now I realized that I should better post the complete programme or you can't get enough information for analyzing the problem.

I simplified the programme a lil bit in the original post because I wanted to save you some time by cutting off some 'unimportant' parts. However, I'm merely a beginner, so what I think to be unimportant might actually be important. Sorry for it!

I added as much comment as I can in order to clarify what I was thinking about.

I wanted to edit my original post but I can't, so I have to re-post the programme at here:

INRDRTST $TITLE 'ZHOUS INTERNAL READER SELF-STUDY'      $TITLE IS SOME MACRO FOR CSECT DEFINITION      
         IFGRPL ,                       CREATE RPL DSECT        
                                                                 
* WORK AREA                                                      
WRK      DSECT ,                        LOCAL VARIABLES          
WRKPL    DC    XL256'00'                A PLIST AREA, NOT QUITE USFUL 4 NOW                        
WRKJCREC DS    CL80''                   OUTPUT RECORD BUFFER                        
WRKACB   DS    XL($RDRACBL)             THE ACB CTRL BLK                      
WRKOPEN  DS    XL($OPENL)               THE CTRL BLK 4 OPEN FILE
WRKCLOSE DS    XL($CLOSEL)              THE CTRL BLK 4 CLOSE FILE
WRKRPL   DS    XL($RDRRPLL)             THE RPL CTRL BLK        
WRKLEN   EQU   *-WRK                                            
                                                                 
INRDRTST $ENTER AMODE=31,CHAIN=FORCE,BASE=(R12,R7,R10)  $ENTER IS SOME MACRO FOR PROCEDURE PROLOG
                                                                 
* PAREPARE WORK AREA                                            
         WTO   'ALLOCATING WORK AREA'                            
         USING WRK,R11                                          
         $GETCB WRK,BASE=(R11),CLEAR=YES                $GETCB IS SOME MACRO FOR ALLOCATING MAIN STORAGE
                                                                 
* NOT SURE WHAT THE PURPOSE IS FOR ENQ ... NO IMPACT FOR RESULT, PLZ IGNORE IT FOR NOW
         MVC   WRKPL(LENQL),LENQ                                
         ENQ   MF=(E,WRKPL)                                      
                                                                 
         WTO   'PREPARING ACB/RPL'                              
         MVC   WRKACB,$RDRACB           COPY CONST ACB TO WORK ACB    
         MVC   WRKOPEN,$OPEN            AND CONST OPEN TO WORK OPEN  
         MVC   WRKCLOSE,$CLOSE          AND CONST CLOSE TO WORK CLOSE
* CONNECT OUTPUT BUFFER WITH RPL AND RPL WITH ACB                
         DS    0H                                                
         LA    R2,WRKRPL                                        
         USING IFGRPL,R2                                        
         LA    R3,WRKACB                RPL -> ACB              
         ST    R3,RPLDACB                                      
         LA    R3,WRKJCREC              OUTPUT BUFFER -> RPL    
         ST    R3,RPLAREA                                      
         WTO   'VSAM CONTROL BLOCK PREPARED'                    
         DROP  R2                                              
                                                               
* OPEN INTERNAL READER AS OUTPUT FILE                          
OPENRDR  DS    0H                                              
         WTO   'OPENING INTERNAL READER'                        
         OPEN  (WRKACB,(OUTPUT)),MF=(E,WRKOPEN)                
         LTR   R2,R15                                          
         BZ    WRITERDR                                        
         WTO   'OPEN FAILED'                                    
                                                               
* WRITE OUT JCL CONTENT                                        
WRITERDR DS    0H                                              
         WTO   'WRITING INTERNAL READER'                        
         LA    R3,JCLLINES                                      
WRLOOP   DS    0H                                              
         WTO   MF=(E,(3))               ECHO BEFORE WRITE OUT  
         LA    R2,4                     SKIP WTO HEADER        
         AR    R3,R2                                            
         CLC   0(1,R3),=C'*'            IS THE EOF LINE?        
         BZ    CLOSERDR                 YES: EXIT LOOP          
         MVC   WRKJCREC,0(R3)           NO:  WRITE TO OUTPUT REC
         LA    R2,80                    GO TO NEXT LINE        
         AR    R3,R2                                            
         PUT   RPL=WRKRPL               OUTPUT REC TO INTERNAL READER  
         LTR   R2,R15                   WORKED?                        
         BZ    WRLOOP                   YES: CONTINUE LOOP            
         WTO   'PUT FAILED'             NO:  LOG ERROR MESSAGE        
                                                                       
* CLOSE INTERNAL READER                                                
CLOSERDR DS    0H                                                      
         WTO   'CLOSING INTERNAL READER'                              
         CLOSE WRKACB,MF=(E,WRKCLOSE)                                  
         LTR   R2,R15                                                  
         BZ    EXIT                                                    
         WTO   'CLOSE FAILED'                                          
                                                                       
EXIT     DS    0H                                                      
         WTO   'EXITING'                                              
         MVC   WRKPL(LDEQL),LDEQ        DEQUEUE                        
         DEQ   MF=(E,WRKPL)                                            
         $FREECB WRK,BASE=(R11)         FREE WORK AREA                
         LA    R2,0                                                    
         $EXIT RC=(R2)                                                
                                                                       
* CONSTANTS                                                            
MYTEST   DC    CL8'MYTEST'                                            
MYRDR   DC    CL8'MYRDR'                                            
JCLLINES DC    H'80'                    4 BYTES HEADER IS FOR ECHO BY WTO
         DC    H'0'                                                    
         DC    CL80'//ZHOUTEST JOB 127300030,ZHOCH02,CLASS=A,REGION=0M'
         DC    H'80'                                                  
         DC    H'0'                                                    
         DC    CL80'//STEP1    EXEC PGM=IEFBR14'                      
         DC    H'80'                                                    
         DC    H'0'                                                    
         DC    CL80'//STEP2    EXEC PGM=IEFBR14'                        
         DC    H'80'                                                    
         DC    H'0'                                                    
         DC    CL80'*'                                                  
                                                                       
* CONTROL BLOCKS                                                        
LENQ     ENQ   (MYTEST,MYRDR,E,L'MYRDR,STEP),RET=HAVE,MF=L          
LENQL    EQU   (*-LENQ)                                                
LDEQ     DEQ   (MYTEST,MYRDR,L'
MYRDR,STEP),RET=HAVE,MF=L            
LDEQL    EQU   (*-LDEQ)                                                
$RDRACB  ACB   DDNAME=MYRDR,MACRF=(ADR,SEQ,OUT)                        
$RDRACBL EQU   *-$RDRACB                                                
$OPEN    OPEN  (,),MF=L                                                
$OPENL   EQU   *-$OPEN                                                  
$CLOSE   CLOSE (,),MF=L                                                
$CLOSEL  EQU   *-$CLOSE                                                
$RDRRPL  RPL   AREALEN=80,OPTCD=(ADR,SEQ,SYN,NUP),RECLEN=80,           -
               ACB=*-*,AREA=*-*                                        
$RDRRPLL EQU   *-$RDRRPL                                                
         END                                                            
 
chong_zhou
 
Posts: 38
Joined: Wed Nov 01, 2017 8:59 pm
Has thanked: 21 times
Been thanked: 0 time

Re: Can't submit job to internal reader

Postby enrico-sorichetti » Fri Dec 21, 2018 6:11 pm

let' use the proper terminology ...
You are not opening the internal reader, You are opening a plain PS dataset
if and when it will be routed to the internal reader depends only on the JCL used to execute the program.

to test if the jcl stream is well build why not route the dd to a real dataset so that You can look at it ?
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
enrico-sorichetti
Global moderator
 
Posts: 2935
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 156 times

Re: Can't submit job to internal reader

Postby chong_zhou » Fri Dec 21, 2018 6:26 pm

Hi Enrico, thanks for your reply.

My test programme uses 'OPEN' macro to open a DD name 'MYRDR', and in the executing JCL of the test programme, the MYRDR is defined as this:
//MYRDR   DD  SYSOUT=(A,INTRDR)


So I think it is 'PUT'ting things into the internal reader. Another evidence is that I got the '$HASP125...INTRDR SKIPPING FOR JOB CARD FROM...' error message after the 'PUT' call.

But your second idea is worth trying --- define the DD name as a plain file and see what I will get. Thank you!
chong_zhou
 
Posts: 38
Joined: Wed Nov 01, 2017 8:59 pm
Has thanked: 21 times
Been thanked: 0 time

Re: Can't submit job to internal reader

Postby enrico-sorichetti » Fri Dec 21, 2018 6:52 pm

the message You get implies that whatever You put there is ... WRONG
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
enrico-sorichetti
Global moderator
 
Posts: 2935
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 156 times

Next

Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post