Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

QWVRCSTK (Retrieve Call Stack) API help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Guest's Avatar
    Guest replied
    QWVRCSTK (Retrieve Call Stack) API help

    There is a previous post that has a link to an example program that helped me solve this problem. Just search on the forum page for the API name QWVRCSTK. Garrett

    Leave a comment:


  • Guest's Avatar
    Guest replied
    QWVRCSTK (Retrieve Call Stack) API help

    I am trying to use this API to retrieve the name of the program that called the program executing when I call the API. Maybe there is a better way to do this. I have checked and checked and checked but keep getting the error message shown in the "raw code" section below. It believe it has to do with the ThreadInd portion of the JobId parm (4th parm, offset 44). Originally, I did not have the length of 56 specified on the JobId data structure definition and the call would end the program. But I noticed in debug that when I looked at the attributes of the data structure it was saying the length was 54 not 56. If I add up the fields in the data structure, I believe it should be a length of 56. So I don't understand the length of 54. After putting the 56 for the DS length, the call to the API doesn't end the job but the API returns the same error information in the Error parameter for the API call. I have verified that I have defined the data structures as indicated in the API manual. I have tried using 10I 0 (int4) definitions for the binary fields instead of the binary definition (per suggestion from a Bob Cozzi article) but that didn't seem to help. I searched the IBM site to see if there were any issues with this API and found none. I have included the code involved in the call to the API in the "raw code" section below. I hope this is not something stupid on my part but it probably will be. Thanks in advance for any help. I love API's and hate them Garrett
    Code

    Leave a comment:


  • B.Morris
    replied
    QWVRCSTK (Retrieve Call Stack) API help

    gpiotto44 wrote: > > I did change all the "4B 0" definitions to "10I 0" and the program. That did fix the JobId length issue. So, now, without having to put 56 on the DS statement, the DS is 56 long. > > Now when I run it I get a slightly different error message: CPF3C3C. The text is "Value for parameter &1 not valid". The &1 value is a 4, so it doesn't like parameter 4 at all but doesn't tell me why. > > It might be related to the fact that in the API manual, parameter 4 is indicated as being variable in length. See section of API manual in the "raw code" section below. However, when I look at the definition for what makes up parameter 4, I see no variability in it. > > I believe, I am initializing all the subfields of parameter 4 as needed. But obviously I am not. > Are you sure the job name,user,num are correct? You don't show where you're getting jobNameEtc from. But since it's the current job, you can just put '*' in the first byte of those 26 bytes. C eval JobName = '*' C eval UserName = ' ' C eval JobNumber = ' ' Or define a 26-byte subfield called JobNameUserNum and set it to '*'. You could define JobName UserName and JobNumber to overlay the 26-byte subfield. To ensure you're correctly setting the reserved fields that have to be hex zeros, I think you'd be better off using *ALLX'00' rather than defining fields initialized to x'0000' etc. But it looks like you did your initializations correctly, so I don't think that's actually the problem. For example: C eval Reserved1 = *ALLX'00' You could also set these on the definition: D reserved3 3a INZ(*ALLX'00') Or eval the whole DS to *ALLX'00' and then only set the fields you have other values for. C eval JobId = *ALLX'00' C eval JobName = %subst(jobNameEtc : 1 : 10) C etc. C eval ThreadInd = x'00000001'

    Leave a comment:


  • Guest's Avatar
    Guest replied
    QWVRCSTK (Retrieve Call Stack) API help

    Thanks for the suggestions Barbara. I have run it in debug many times and it appears the job name, user, number are being correctly populated. I am passing in a 26 character field. I would think if I have populated them incorrectly I would get a job not found error. I will try running in debug and forcing the job stuff to indicate the current job instead. I am making this a procedure so I didn't want to assume the job would always be the current one. Thanks again for your thoughts, Garrett

    Leave a comment:


  • Guest's Avatar
    Guest started a topic QWVRCSTK (Retrieve Call Stack) API help

    QWVRCSTK (Retrieve Call Stack) API help

    I did change all the "4B 0" definitions to "10I 0" and the program. That did fix the JobId length issue. So, now, without having to put 56 on the DS statement, the DS is 56 long. Now when I run it I get a slightly different error message: CPF3C3C. The text is "Value for parameter &1 not valid". The &1 value is a 4, so it doesn't like parameter 4 at all but doesn't tell me why. It might be related to the fact that in the API manual, parameter 4 is indicated as being variable in length. See section of API manual in the "raw code" section below. However, when I look at the definition for what makes up parameter 4, I see no variability in it. I believe, I am initializing all the subfields of parameter 4 as needed. But obviously I am not. Any help would be fantastic. Thanks, Garrett
    Code
Working...
X