Re: Anyone need a random number generator?
Ron Hudson <[email protected]>
| Newsgroups | gmane.comp.emulators.turnkey-mvs |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Apr 28, 2010 at 12:39 PM, Rick Fochtman <[email protected]> wrote: > > > ----------------------------<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.) > :-) > Not experienced at all before the first time you saw me on the list. I had run Hercules once before but did not get anywhere with it at all. That's why it says Ron the noob. Wanna know anything about Novell up to version 4.0? (I also know a little about 5.0) > (Given the math I see there, you might experience integer overflow > conditions in the first argument to the MOD function.) > What can I do? I guess I need to user a 'larger' integer - What is a good reference (there is a short overview on Jay Moseley's site but no detail like how to specify more bits... What kind of fortran is IBM FORTRAN H? III? IV? 66? 77? (I know it was before 1977) Ron the Mainframe Noob. > > Rick<[email protected]?subject=Anyone%20need%20a%20random%20number%20generator?><[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--> > >