Gord Tomlin wrote:
Apparently I'm a bit thick today, but I cannot seem to get the results I want from the IPCS RUNARRAY subcommand when combined with the CBFORMAT command.

I have an array of control blocks in a dump, and I want to use a format model to display each element of the array. In a simple example, each element is x'19' bytes long and there are four elements. I entered the following command:

runarray address(2a401b00.) length(25) entries(1:4) structure
exec((cbf x model(<format-model-name>)))

Instead of seeing each of the four elements formatted, I see all but the first element truncated with zeroes replacing the data that actually resides at the storage locations:

LIST 2A401B00. ASID(X'00BA') LENGTH(X'19') ENTRY(X'+01') STRUCTURE
:2A401B00
+0000 ENTRYFLG. 00 NAME..... #........ 00000001 CPUTOT... 00000000 Z#....... 00000000 ZCPUTOT.. 00000000

LIST 2A401B00. ASID(X'00BA') POSITION(X'+19') LENGTH(X'19') ENTRY(X'+02') STRUCTURE
:2A401B00
+0000 ENTRYFLG. 00 NAME..... ........ #........ 00000000 CPUTOT... 00000000 Z#....... 00000000 ZCPUTOT.. 00000000
Control block is truncated

LIST 2A401B00. ASID(X'00BA') POSITION(X'+32') LENGTH(X'19') ENTRY(X'+03') STRUCTURE
:2A401B00
+0000 ENTRYFLG. 00 NAME..... ........ #........ 00000000 CPUTOT... 00000000 Z#....... 00000000 ZCPUTOT.. 00000000
Control block is truncated

LIST 2A401B00. ASID(X'00BA') POSITION(X'+4B') LENGTH(X'19') ENTRY(X'+04') STRUCTURE
:2A401B00
+0000 ENTRYFLG. 00 NAME..... ........ #........ 00000000 CPUTOT... 00000000 Z#....... 00000000 ZCPUTOT.. 00000000
Control block is truncated

The actual storage is as follows:
2A401B00. 00404040 40404040 40000000 01000000 00000000 00000000 00000000 00000000 2A401B20. 00000000 00010000 00000000 00000000 0000005C E4D5D2D5 D6E6D500 00000000 2A401B40. 00000000 00000000 00000000 D4E9F1C3 E2C3C8F7 00000001 00000102 00000000
2A401B60. 00000102

Any suggestions as to how to get CBFORMAT to use the intended length for each array element?


Your focus on the length is on the wrong aspect of this. RUNARRAY processes array entries by updating the POSITION attribute as you see from the model LIST subcommands. The model processor assumes a zero offset as the origin of the list of fields that it processes, and all of the fields for the 2nd and subsequent array entries fall in the range prior to the "origin" of that array entry. You can circumvent that with a command procedure, but I don't think that there's a single command solution to getting the job done, eg:

  PROC 0
  EVALSYM X CLIST(POSITION(P) LENGTH(L) HEXADECIMAL)
  CBFORMAT X+&P POSITION(0) LENGTH(&L.) MODEL(<format-model-name>)

When an offset is used in an address expression and the POSITION keyword is also used, IPCS sums the current address and offset values to form the logical address of the target and sets the offset to the value specified by the POSITION operand. That lets your one model that assumes a zero origin work against each array entry - if you invoke the CLIST instead of directly invoking the CBFORMAT subcommand.

Bob Wright - MVS Service Aids

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to