Comparing two DC - S0C1



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

Re: Comparing two DC - S0C1

Postby thermaltaker » Sun Oct 28, 2018 4:28 pm

Thank you very much for the explanation. Now it's ok, I test it and my code for comparing work perfect.

I moved to next step. I have my code as exit after submit every job. And my intention is compare job name with my dc containing any job name.. If this two jobnames are equal then WTO 'Equal'...

My code return with a DUMP...

My input address of parameters is in register 1. (https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieae400/ieae40036.htm#ieae400-gen35__procuji)
And first ford of this register is address for common exit parameter area and in this area is on the first place JOBNAME. But my code, doesn't work..

Here is example of my code..

        TITLE 'ASMTEST'                          
ASMTEST  CSECT                                    
ASMTEST  RMODE ANY                                
ASMTEST  AMODE 31                                
*        PRINT GEN                                
R0       EQU   0                                  
R1       EQU   1                                  
R2       EQU   2                                  
R3       EQU   3                                  
R4       EQU   4                                  
R5       EQU   5                                  
R6       EQU   6                                  
R7       EQU   7                                  
R8       EQU   8                                  
R9       EQU   9                                  
R10      EQU   10                                
R11      EQU   11                                
R12      EQU   12                                
R13      EQU   13                                
R14      EQU   14                                
R15      EQU   15                                
         SAVE  (14,2),,ASMTEST-&SYSTIME.-&SYSDATE.
         LR    R2,R15             BASE REGISTER  
         USING ASMTEST,R2                        
*                                                
         L     R3,0(,R1)                          
         CLC   1(8,R3),MYJOBNAME                  
         BNE   EXIT2                              
*                                                
EXIT1    WTO   'EQUAL'                            
         LA    R15,0                              
         B     EXIT                              
*                                                
*                                                                
EXIT2    WTO   'NOT EQUAL'                                        
         LA    R15,0                                              
EXIT     RETURN (14,2),,RC=(15)   RETURN WITH RETURN CODE IN R15  
*                                                                
MYJOBNAME DC    CL8'TESTJOBN'                                    
*                                                                
         END                                                      


I don't want create a new thread in the forum so I writing it here ..
thermaltaker
 
Posts: 4
Joined: Sat Oct 27, 2018 1:20 am
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing two DC - S0C1

Postby enrico-sorichetti » Sun Oct 28, 2018 6:32 pm

unfortunately we are all wasting time
Your skill level is not high enough to start dealing with zOS exits.
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: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Comparing two DC - S0C1

Postby thermaltaker » Sun Oct 28, 2018 6:40 pm

Ok, I understand.. Thank you very much for your time.. I will read much more documentation and study more examples..
thermaltaker
 
Posts: 4
Joined: Sat Oct 27, 2018 1:20 am
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing two DC - S0C1

Postby steve-myers » Sun Oct 28, 2018 7:29 pm

Several comments.
  1. Your link points to a discussion of several exits. Which exit are you trying? The IEFUJI exit - if that is the exit you are trying - is not entered until the system is starting to run the job, which is much later in the process than "after submit every job," which implies immediately after the job is submitted before the system decides it is going to run the job.
  2. I sort of recall looking for an exit at roughly where you seem to want to insert your exit and concluded that IEFUJI was too late. Mind you, this was at least 10 years ago, and probably much longer ago than that, so my memory is probably faulty.
  3. At least one of the exits in the link is entered in key 0. I admit we all have to try new things, but No way a beginner who is not certain how the USING Assembler instruction works should be writing operating system exits entered in a privileged state.
  4. You save and restore registers 14, 15, 0, 1 and 2, but you modify register 3 without saving and restoring it. This sort of echoes a warning Mr. Jensen made.
  5. When you execute your CLC instruction, I think register 3 points to the job name. As the CLC instruction is written, it is starting to test at the second byte in the job name, which I do not think is what you intend.
  6. You carefully store what appears to be a return code in register 15. Then your RETURN macro specifies RC=0, which replaces the return code you stored in register 15. What you want to do is specify RC=(15) to use the return code in register 15. RC=(R15) will not work.
  7. Saying xxx does not work in these forums is totally useless. Where (in the exit) did it fail? Or did it fail somewhere else?
I stopped using Rxx symbol names for registers years ago. This was popular 50 years ago for a couple of reasons.
  • IBM coding standards forbid the use of "magic numbers" like 1 for register 1. But R1 is not a "magic number," even though R1 EQU 1 equates R1 to a magic number. In other words, the standard is BS.
  • R1 appears in the Assembler symbol table, where the magic number 1 does not. This can be sort of useful. Sometimes. However, High Level Assembler now has the register XREF table, which is much more useful than R1 in the symbol table. More accurate, too, as the symbol table misses some register usage that the register XREF table does not miss. For example, the TRT instruction may alter registers 1 and 2, which would not be recorded in the symbol table, but would be noted in the register XREF table.
I have a macro, SETR, to create the symbol names. But I have to use the macro, which I frequently forgot to do. This resulted in a first assembly with dozens of symbols not defined messages. All I could do is resubmit. This was important 50 years ago when we counted ourselves lucky to get one turnaround of a batch job a day. Now, of course, we have the YREGS macro which didn't exist 50 years ago, but we still have to use it!
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Comparing two DC - S0C1

Postby steve-myers » Mon Oct 29, 2018 8:40 am

willy jensen wrote:...
4. your use of r0 as index and length don't make any sense'
...

I assume your're referring to the R0 in L R3,0(R0,R2) The instruction is nonsense for other reasons, but the R0 as the specification for the index register is perfectly OK. You get the same result in L R3,0(,R2).

However, as you say, the use of R0 as the length value in CLC 0(R0,R3),VALUE2 is nonsense.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Comparing two DC - S0C1

Postby willy jensen » Mon Oct 29, 2018 1:55 pm

@steve-myers, you are quite right, I spoke too fast/wasn't clear, good of you to clarify.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Previous

Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post