Consider $b = ka$ for some integer $k > 1$. Then we have
$$a^2 + b^2 = a^2 + \left(ka\right)^2 = \left(1 + k^2\right)a^2 = z^3 \tag{1}\label{eq1} $$
Now, if $z = a$, \eqref{eq1} would be true if
$$k^2 + 1 = a \tag{2}\label{eq2} $$
Thus, if $k = 2$ for example, then $a = 5$ and $b = 10$ giving
$$5^2 + 10^2 = 5^3 \tag{3}\label{eq3} $$
There are, of course, many other such similar examples. If you wish for $a \neq z$ as well, then you could also have, for example, that $z = ga$, for an integer $g \gt 1$, so $1 + k^2 = \left(g^3\right)a$, but there are no solutions for certain cases, such as $g = 2$.
More generally, if you wish to have other restrictions, such as that $\gcd\left(a, b, z\right) = 1$, then consider what coffeemath wrote in a comment to the question. In particular, any number $n$ is a sum of two squares if and only if all prime factors of $n$ which are $\; 3 \mod 4 \; $ have an even exponent in the prime factorization of $n$. This is stated and proven in Which Numbers are the Sum of Two Squares?. Thus, any $z$ with all prime factors which are $\; 3 \mod 4 \; $ having an even exponent in its prime factorization will work. My example of $5$ is basically the simplest such case involving positive integers.
As Mike Miller pointed out in the comments to this answer, there is a formula for the number of representations of a number as the sums of squares at Sums of squares function, although you might need to remove cases where it provides $a$ or $b$ to be $0$ as the question specifically is looking for only positive integer solutions.