Re: Anyone need a random number generator?
Rick Fochtman <[email protected]>
| Newsgroups | gmane.comp.emulators.turnkey-mvs |
|---|---|
| Message-ID | <[email protected]> |
----------------------------<snip>------------------------- > > > //MYLIB JOB CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=HUDSON > //COMPILE EXEC FORTHC,REGION.FORT=384K > //FORT.SYSLIN DD DSNAME=MYLIB,DISP=(MOD,PASS) > //FORT.SYSABEND DD SYSOUT=A > //FORT.SYSIN DD * > C RANDOM NUMBER GENERATOR > FUNCTION IRND(ISEED) > IY = IABS(MOD(1103515245 * ISEED + 12345,2**15)) > IRND = IY > RETURN > END > --------------------------<unsnip>--------------------------------- You really need to store the results of the compile in a permanent library. Try adding the following after the FORTRAN "END" statement: //LKED EXEC PGM=IEWL,PARM='LIST,LET,NCAL,MAP' //SYSPRINT DD SYSOUT=A //SYSLMOD DD DSN=SYS1,FORTLIB(IRND),DISP=SHR <-- member name is LMOD name when link is complete //SYSUT1 DD UNIT=SYSALLDA,SPACE=(TRK,(15,15)) //SYSLIN DD DSN=MYLIB,DISP=(OLD,DELETE) The MAP parm will show you the actual LMOD length, so you can verify that it's been stored. And by storing in SYS1.FORTLIB, your users don't need to specify any other libraries. (I have the impression that you're not heavily experienced in using MVS.) :-) (Given the math I see there, you might experience integer overflow conditions in the first argument to the MOD function.) Rick <mailto:[email protected]?subject=Anyone%20need%20a%20random%20number%20generator?> <mailto:[email protected]?subject=Anyone%20need%20a%20random%20number%20generator?> <http://groups.yahoo.com/group/turnkey-mvs/post;_ylc=X3oDMTJwYjNyZWxhBF9TAzk3MzU5NzE0BGdycElkAzgxNjExNjIEZ3Jwc3BJZAMxNzA1MDA2NTU5BG1zZ0lkAzY1MzQEc2VjA2Z0cgRzbGsDcnBseQRzdGltZQMxMjcyNDcyNDYz?act=reply&messageNum=6534> <http://groups.yahoo.com/group/turnkey-mvs/post;_ylc=X3oDMTJlM2FpMWxiBF9TAzk3MzU5NzE0BGdycElkAzgxNjExNjIEZ3Jwc3BJZAMxNzA1MDA2NTU5BHNlYwNmdHIEc2xrA250cGMEc3RpbWUDMTI3MjQ3MjQ2Mw-->