To add more to the thread...
!KO_mvnorm generates random data from normal population with specified covariances/correlations.
!KO_tocov brings data at hand to covariate/correlate exactly as you want.
Both functions (which are SPSS macros) are found in "MATRIX – END MATRIX functions" collection on my web-page
https://www.spsstools.net/en/macros/KO-spssmacros/------------------------------
Kirill Orlov
------------------------------