Discussion:
Anyone need a random number generator?
Ron Hudson
2010-04-28 16:34:01 UTC
Permalink
//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

Well yes, it's a bog-standard linear congruential pseudo random number
generator.


This is only a semi free offer however (or should I say it's another
opportunity to
help the newbie)

I am trying to compile this so I can call it from other programs. I can run
the
above job without any errors, but in the listing I see

mylib deleted

and I don't see any new files in my catalog (but perhaps it would be better
if it were someplace "all my users" could access)

I even made a first attempt by editing the //fort.syslin which did not have
a
disposition parameter before.

Ron...
Mike Stramba
2010-04-28 16:52:34 UTC
Permalink
Your JCL doesn't have any link edit content, so the executable or the
object is not going to be written anywhere.

http://www.jaymoseley.com/hercules/compilers/syscpk.htm

http://www.jaymoseley.com/hercules/compiling/compile.htm
Post by Ron Hudson
//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
Well yes, it's a bog-standard linear congruential pseudo random number
generator.
This is only a semi free offer however (or should I say it's another
opportunity to
help the newbie)
I am trying to compile this so I can call it from other programs. I can run
the
above job without any errors, but in the listing I see
mylib deleted
and I don't see any new files in my catalog (but perhaps it would be better
if it were someplace "all my users" could access)
I even made a first attempt by editing the //fort.syslin which did not have
a
disposition parameter before.
Ron...
Ron Hudson
2010-04-28 17:00:13 UTC
Permalink
So I need to replace "forthc" in the compile line with "forthcl" ?

And that will produce an object file that can be linked in to other programs
at their
compile time?
Post by Mike Stramba
Your JCL doesn't have any link edit content, so the executable or the
object is not going to be written anywhere.
http://www.jaymoseley.com/hercules/compilers/syscpk.htm
http://www.jaymoseley.com/hercules/compiling/compile.htm
//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
Well yes, it's a bog-standard linear congruential pseudo random number
generator.
This is only a semi free offer however (or should I say it's another
opportunity to
help the newbie)
I am trying to compile this so I can call it from other programs. I can
run
the
above job without any errors, but in the listing I see
mylib deleted
and I don't see any new files in my catalog (but perhaps it would be
better
if it were someplace "all my users" could access)
I even made a first attempt by editing the //fort.syslin which did not
have
a
disposition parameter before.
Ron...
Carlos Aguilera
2010-04-28 17:40:30 UTC
Permalink
You Need a linkage editor step like



//LK1 EXEC PGM=IEWL,PARM='MAP,RENT,REUS,REFR,NCAL',COND=(0,LT)

//PRINT DD SYSOUT=*

//IN DD DSN=mylib,DISP=(OLD,DELETE)

//SYSLMOD DD DISP=SHR,DSN=linklib.LIB <<=== LINK TARGET

//SYSUT1 DD UNIT=VIO,SPACE=(TRK,(5,5))

//SYSLIN DD *

NAME PDS85(R) <<=== LOADMOD name







Carlos Aguilera



_____

From: turnkey-mvs-***@public.gmane.org [mailto:turnkey-mvs-***@public.gmane.org] On
Behalf Of Ron Hudson
Sent: Wednesday, April 28, 2010 1:00 PM
To: turnkey-mvs-***@public.gmane.org
Subject: Re: [turnkey-mvs] Anyone need a random number generator?





So I need to replace "forthc" in the compile line with "forthcl" ?

And that will produce an object file that can be linked in to other programs
at their
compile time?

On Wed, Apr 28, 2010 at 9:52 AM, Mike Stramba <mikestramba@
<mailto:mikestramba-***@public.gmane.org> gmail.com> wrote:



Your JCL doesn't have any link edit content, so the executable or the
object is not going to be written anywhere.

http://www.jaymosel
<http://www.jaymoseley.com/hercules/compilers/syscpk.htm>
ey.com/hercules/compilers/syscpk.htm

http://www.jaymosel
<http://www.jaymoseley.com/hercules/compiling/compile.htm>
ey.com/hercules/compiling/compile.htm
//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
Well yes, it's a bog-standard linear congruential pseudo random number
generator.
This is only a semi free offer however (or should I say it's another
opportunity to
help the newbie)
I am trying to compile this so I can call it from other programs. I can run
the
above job without any errors, but in the listing I see
mylib deleted
and I don't see any new files in my catalog (but perhaps it would be better
if it were someplace "all my users" could access)
I even made a first attempt by editing the //fort.syslin which did not
have
a
disposition parameter before.
Ron...
Ron Hudson
2010-04-28 18:04:04 UTC
Permalink
Hi Carlos

I am not sure what to do with your suggested code, does it go at the end of
my deck?

FORTHCL has a LKED step built in, but parts may need overrides.
The code from FORTHCL is here:
http://www.jaymoseley.com/hercules/compiling/cprocs4.htm#FORTHCL

I do see that I need to end my fortran code with a '//'
Post by Carlos Aguilera
You Need a linkage editor step like
//LK1 EXEC PGM=IEWL,PARM='MAP,RENT,REUS,REFR,NCAL',COND=(0,LT)
//PRINT DD SYSOUT=*
//IN DD DSN=mylib,DISP=(OLD,DELETE)
//SYSLMOD DD DISP=SHR,DSN=linklib.LIB <<=== LINK TARGET
//SYSUT1 DD UNIT=VIO,SPACE=(TRK,(5,5))
//SYSLIN DD *
NAME PDS85(R) <<=== LOADMOD name
Carlos Aguilera
------------------------------
Behalf Of *Ron Hudson
*Sent:* Wednesday, April 28, 2010 1:00 PM
*Subject:* Re: [turnkey-mvs] Anyone need a random number generator?
So I need to replace "forthc" in the compile line with "forthcl" ?
And that will produce an object file that can be linked in to other
programs at their
compile time?
Your JCL doesn't have any link edit content, so the executable or the
object is not going to be written anywhere.
http://www.jaymoseley.com/hercules/compilers/syscpk.htm
http://www.jaymoseley.com/hercules/compiling/compile.htm
//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
Well yes, it's a bog-standard linear congruential pseudo random number
generator.
This is only a semi free offer however (or should I say it's another
opportunity to
help the newbie)
I am trying to compile this so I can call it from other programs. I can
run
the
above job without any errors, but in the listing I see
mylib deleted
and I don't see any new files in my catalog (but perhaps it would be
better
if it were someplace "all my users" could access)
I even made a first attempt by editing the //fort.syslin which did not
have
a
disposition parameter before.
Ron...
Rick Fochtman
2010-04-28 19:39:45 UTC
Permalink
----------------------------<snip>-------------------------
Post by Ron Hudson
//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:hudson.ra-***@public.gmane.org?subject=Anyone%20need%20a%20random%20number%20generator?>
<mailto:turnkey-mvs-***@public.gmane.org?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-->
Ron Hudson
2010-04-28 20:03:32 UTC
Permalink
Post by Rick Fochtman
----------------------------<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.
//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)
Post by Rick Fochtman
(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.
Tony Harminc
2010-04-28 20:20:31 UTC
Permalink
What kind of fortran is IBM FORTRAN H?  III?   IV?   66?  77? (I know it was before 1977)
IV.

Tony H.
Mike Schwab
2010-04-28 20:33:34 UTC
Permalink
<<deleted>>
//FORT.SYSIN    DD *
C RANDOM NUMBER GENERATOR
      FUNCTION IRND(ISEED)
      IY = IABS(MOD(1103515245 * ISEED + 12345,2**15))
      IRND = IY
      RETURN
      END
<<deleted>>
(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...
The assembler equivalent should run (i.e. not overflow the registers),
not sure about how this particular compiler creates the machine
instructions. You will need to test by calling the routine and
logging the results.
<deleted>
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
Rick Fochtman
2010-04-28 21:12:06 UTC
Permalink
-------------------------------<snip>-------------------------------
Post by Mike Schwab
<<deleted>>
Post by Ron Hudson
Post by Ron Hudson
//FORT.SYSIN DD *
C RANDOM NUMBER GENERATOR
FUNCTION IRND(ISEED)
IY = IABS(MOD(1103515245 * ISEED + 12345,2**15))
IRND = IY
RETURN
END
<<deleted>>
Post by Ron Hudson
Post by Ron Hudson
(Given the math I see there, you might experience integer overflow
conditions in the first argument to the MOD function.)
Post by Ron Hudson
What can I do? I guess I need to user a 'larger' integer - What is
a good reference (there is a short overview
Post by Ron Hudson
on Jay Moseley's site but no detail like how to specify more bits...
The assembler equivalent should run (i.e. not overflow the registers),
not sure about how this particular compiler creates the machine
instructions. You will need to test by calling the routine and
logging the results.
------------------------------------<unsnip>----------------------------------
Doing it in Assembler will not "use more bits". FORTH uses the full 32
bits of the 370 architecture. Since the value 1,103,515,245 is being
multiplied by the ISEED parameter, the resultant value may easily exceed
32 bits. Perhaps even exceeding the 64 bits result of the multiply
instruction. Then what?

Rick
Mike Schwab
2010-04-28 21:21:15 UTC
Permalink
Post by Mike Schwab
<<deleted>>
//FORT.SYSIN    DD *
C RANDOM NUMBER GENERATOR
      FUNCTION IRND(ISEED)
      IY = IABS(MOD(1103515245 * ISEED + 12345,2**15))
      IRND = IY
      RETURN
      END
<<deleted>>
(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...
The assembler equivalent should run (i.e. not overflow the registers),
not sure about how this particular compiler creates the machine
instructions. You will need to test by calling the routine and
logging the results.
------------------------------------<unsnip>----------------------------------
Doing it in Assembler will not "use more bits". FORTH uses the full 32 bits of the 370 architecture. Since the value 1,103,515,245 is being multiplied by the ISEED parameter, the resultant value may easily exceed 32 bits. Perhaps even exceeding the 64 bits result of the multiply instruction. Then what?
Rick
Correct. S/370 M or MR multiplies two signed 32 bit operands and
places the result in a odd-even pair of 32 bit registers. The result
cannot exceed 64 bits. 7FFFFFFF * 7FFFFFFF will fit.
Then the S/370 D or DR diviides an odd-even pair of 32 bit registers
by the 2**15 result and could result in an overflow condition. Since
he is desiring the MOD result, losing the high order bits of the
result is of no consequence.

--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
Rick Fochtman
2010-04-29 18:14:38 UTC
Permalink
-----------------------------------<Another
snip>---------------------------------------
Post by Mike Schwab
<<deleted>>
Post by Ron Hudson
Post by Ron Hudson
//FORT.SYSIN DD *
C RANDOM NUMBER GENERATOR
FUNCTION IRND(ISEED)
IY = IABS(MOD(1103515245 * ISEED + 12345,2**15))
IRND = IY
RETURN
END
<<deleted>>
Post by Ron Hudson
Post by Ron Hudson
(Given the math I see there, you might experience integer
overflow conditions in the first argument to the MOD function.)
Post by Mike Schwab
Post by Ron Hudson
What can I do? I guess I need to user a 'larger' integer - What
is a good reference (there is a short overview
Post by Mike Schwab
Post by Ron Hudson
on Jay Moseley's site but no detail like how to specify more bits...
The assembler equivalent should run (i.e. not overflow the registers),
not sure about how this particular compiler creates the machine
instructions. You will need to test by calling the routine and
logging the results.
------------------------------------<unsnip>----------------------------------
Post by Mike Schwab
Doing it in Assembler will not "use more bits". FORTH uses the full
32 bits of the 370 architecture. Since the value 1,103,515,245 is
being multiplied by the ISEED parameter, the resultant value may
easily exceed 32 bits. Perhaps even exceeding the 64 bits result of
the multiply instruction. Then what?
Post by Mike Schwab
Rick
Correct. S/370 M or MR multiplies two signed 32 bit operands and
places the result in a odd-even pair of 32 bit registers. The result
cannot exceed 64 bits. 7FFFFFFF * 7FFFFFFF will fit.
Then the S/370 D or DR diviides an odd-even pair of 32 bit registers
by the 2**15 result and could result in an overflow condition. Since
he is desiring the MOD result, losing the high order bits of the
result is of no consequence.
--------------------------------<end of "Another
snip">--------------------------
That's true, with respect to the basic arithmetic. But the FORTRAN error
handler might not see it that way. :-)

Rick
Ron Hudson
2010-04-28 21:32:35 UTC
Permalink
Post by Rick Fochtman
//SYSLMOD DD DSN=SYS1,FORTLIB(IRND),DISP=SHR <-- member name is LMOD name
when link is complete
-----------------------------------------------------------^^^^^
If I wanted to add other subroutines or functions to the source code would
that be ok too?

or should I duplicate this whole file and change names?
Gerhard Postpischil
2010-04-28 23:14:48 UTC
Permalink
Post by Ron Hudson
If I wanted to add other subroutines or functions to the
source code would that be ok too?
or should I duplicate this whole file and change names?
Neither? Adding something to a system library is generally
considered undesirable; just consider what you will do when the
latest and greatest MVS release becomes available - do you
rename the volumes, copy all your changes from the old system,
and then name them back?

The common way of doing this is to use your own library, and
concatenate it either in front, or behind, the system library
when you run. For example:

//LKED.SYSLIB DD
// DD DISP=SHR,DSN=rons.library

Note that doing this requires that the format of your library be
the same as the system's. Since SYS1.FORTLIB is a load-module
library (PDS with RECFM=U), your link-edit output will be just
fine. But in an earlier post you mentioned object code, which is
what the compiler produces in SYSLIN, and you fed into to LKED
step; these two forms are not interchangeable.



Gerhard Postpischil
Bradford, VT
Ron Hudson
2010-04-28 23:37:53 UTC
Permalink
On Wed, Apr 28, 2010 at 4:14 PM, Gerhard Postpischil
Post by Ron Hudson
If I wanted to add other subroutines or functions to the
source code would that be ok too?
or should I duplicate this whole file and change names?
Neither? Adding something to a system library is generally
considered undesirable; just consider what you will do when the
latest and greatest MVS release becomes available - do you
rename the volumes, copy all your changes from the old system,
and then name them back?
Re-install the items into the new library? (also this supposes that
IBM will let us have MVS 40 A free and public domain...)
The common way of doing this is to use your own library, and
concatenate it either in front, or behind, the system library
//LKED.SYSLIB DD
// DD DISP=SHR,DSN=rons.library
Yes, Is there a way for my to share rons.library with others on the system
(I am pretending this is a production system and I am an operator
and system analyst in a shop with others)
Note that doing this requires that the format of your library be
the same as the system's. Since SYS1.FORTLIB is a load-module
library (PDS with RECFM=U), your link-edit output will be just
fine. But in an earlier post you mentioned object code, which is
what the compiler produces in SYSLIN, and you fed into to LKED
step; these two forms are not interchangeable.
and I am doing to learn in an area in which I have very little experience
so I barely understand what you are saying but I have no idea how
to properly implement it.

I may even have a random number generator in some library somewhere
that I don't know about.
Gerhard Postpischil
Bradford, VT
Ron Hudson
2010-04-29 15:54:30 UTC
Permalink
Well it looks like the parameters I found turn out to be a spectacularly bad
PRNG..


- I collect pairs of random numbers between 1 and 40, use them as X,Y
indexes to increment cells of an array.
- do the above until the increment takes one of the cells to 100
- Print out the array

I find cells get incremented to 99 in a sea of zeros (32 "islands" of 99)
and a smattering of 1s and 2s

: ^ (

Is there a system function or insintric or some way to get -good- random
numbers?
Ron Hudson
2010-04-29 16:25:06 UTC
Permalink
Here are better numbers....

C RANDOM NUMBER GENERATOR
FUNCTION IRND(ISEED)
INTEGER IY
IY = IABS(MOD(31421 * ISEED + 6927,2**15))
IRND = IY
RETURN
END

I must have been suffering overflow much more than I though.
Post by Ron Hudson
Well it looks like the parameters I found turn out to be a spectacularly
bad PRNG..
- I collect pairs of random numbers between 1 and 40, use them as X,Y
indexes to increment cells of an array.
- do the above until the increment takes one of the cells to 100
- Print out the array
I find cells get incremented to 99 in a sea of zeros (32 "islands" of 99)
and a smattering of 1s and 2s
: ^ (
Is there a system function or insintric or some way to get -good- random
numbers?
Rick Fochtman
2010-04-29 18:18:59 UTC
Permalink
------------------------------<snip>---------------------------------------
Post by Rick Fochtman
//SYSLMOD DD DSN=SYS1,FORTLIB(IRND),DISP=SHR <-- member name is
LMOD name when link is complete
-----------------------------------------------------------^^^^^
Rick
<http://groups.yahoo.com/group/turnkey-mvs/post;_ylc=X3oDMTJwYjNyZWxhBF9TAzk3MzU5NzE0BGdycElkAzgxNjExNjIEZ3Jwc3BJZAMxNzA1MDA2NTU5BG1zZ0lkAzY1MzQEc2VjA2Z0cgRzbGsDcnBseQRzdGltZQMxMjcyNDcyNDYz?act=reply&messageNum=6534>
If I wanted to add other subroutines or functions to the source code
would that be ok too?
or should I duplicate this whole file and change names?
---------------------------------<unsnip>------------------------------
You might want to build a separate library for your additions; in my own
way of thinking, I'd call it "SYS2.FORTLIB" and add it to the SYSLIB
concatenation in any LINKEDIT or LOADER steps in my FORTRAN procs. That
might be helpful in separating your routines from the IBM-supplied library.

Rick
Ron Hudson
2010-04-29 21:00:45 UTC
Permalink
Thanks Rick..
Post by Rick Fochtman
You might want to build a separate library for your additions; in my own
way of thinking, I'd call it "SYS2.FORTLIB" and add it to the SYSLIB
concatenation in any LINKEDIT or LOADER steps in my FORTRAN procs. That
might be helpful in separating your routines from the IBM-supplied library.
Ok, I changed the JCL line to read SYS2.FORTLIB and it said that "**** IRND
now replaced in data set"

1) now how do I remove the old one from SYS1.FORTLIB ?
2) what do I do to use it in it's new place?
Post by Rick Fochtman
Rick
Mike Stramba
2010-04-29 21:15:56 UTC
Permalink
Post by Ron Hudson
1) now how do I remove the old one from SYS1.FORTLIB ?
You can do it interactively from TSO (my preference), or using IBM
utilities and JCL (which I don't know what the magic incantaion is ...
I think you can use either IDCAMS with DELETE statements or just
IEBFR14 (the dummy program), with MOD,DELETE or some such in the DISP
parameter.
pds 'SYS1.FORTLIB' (you need the quotes)
d(isplay) <oldname>

- should display your old file

- del <filename> .... make sure you're deleting the right thing ...
of course you already have a backup right ?

- end (exits the PDS program).
Ron Hudson
2010-04-29 21:36:50 UTC
Permalink
RPF helped deleting the old member.

How do I tell my program where IRND is now?

Ron.
Post by Mike Stramba
Post by Ron Hudson
1) now how do I remove the old one from SYS1.FORTLIB ?
You can do it interactively from TSO (my preference), or using IBM
utilities and JCL (which I don't know what the magic incantaion is ...
I think you can use either IDCAMS with DELETE statements or just
IEBFR14 (the dummy program), with MOD,DELETE or some such in the DISP
parameter.
pds 'SYS1.FORTLIB' (you need the quotes)
d(isplay) <oldname>
- should display your old file
- del <filename> .... make sure you're deleting the right thing ...
of course you already have a backup right ?
- end (exits the PDS program).
Mike Schwab
2010-04-29 21:57:19 UTC
Permalink
Post by Ron Hudson
RPF helped deleting the old member.
How do I tell my program where IRND is now?
Ron.
//ddname DD DSN=SYS2.FORTLIB,DISP=SHR
// DD DSN=SYS1.FORTLIB, DISP=SHR
It searches the libraries in order for each name.
The first dataset name sets the blocksize, so you may need to override
the blocksize to the largest value.
The advantage of putting your dataset first is to provide a substitute
module for an existing name for testing purposes.

--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
Ron Hudson
2010-04-29 22:23:09 UTC
Permalink
Post by Mike Schwab
//ddname DD DSN=SYS2.FORTLIB,DISP=SHR
// DD DSN=SYS1.FORTLIB, DISP=SHR
I did this:

//GRID JOB CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=HUDSON
//FORT EXEC FORTHCLG,REGION.FORT=384K
//FORT.SYSLIN DD UNIT=SYSDA
//FORT.SYSABEND DD SYSOUT=A
//FORT.SYSIN DD *
C 34567
DIMENSION IGRID(40,40)
.
. fortran program here
.
END
//
//LKED.SYSLIB DD DSN=SYS2.FORTLIB,DISP=SHR,
// DD DSN=SYS1.FORTLIB,DISP=SHR

I am using the built in 'forthclg' (fortran h link and go) procedure.
so I think "fort.syslin" overrides the "syslin" line in the procedure - So
I thought I had to override the 'syslib' lines..
Ron Hudson
2010-04-29 22:47:29 UTC
Permalink
Post by Ron Hudson
Post by Mike Schwab
//ddname DD DSN=SYS2.FORTLIB,DISP=SHR
// DD DSN=SYS1.FORTLIB, DISP=SHR
//GRID JOB CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=HUDSON
//FORT EXEC FORTHCLG,REGION.FORT=384K
//FORT.SYSLIN DD UNIT=SYSDA
//FORT.SYSABEND DD SYSOUT=A
//FORT.SYSIN DD *
C 34567
DIMENSION IGRID(40,40)
.
. fortran program here
.
END
//
//LKED.SYSLIB DD DSN=SYS2.FORTLIB,DISP=SHR,
// DD DSN=SYS1.FORTLIB,DISP=SHR
I am using the built in 'forthclg' (fortran h link and go) procedure.
so I think "fort.syslin" overrides the "syslin" line in the procedure - So
I thought I had to override the 'syslib' lines..
oops, I suppose I should say that the link step in forthclg still does not
seem to see sys2.fortlib
Post by Ron Hudson
From the listing It looks like the override is not hapening...
Also is there a way to tell if SYS2.FORTLIB(IRAND) was properly formed?

What do I do with the DDNAME item?
Ron Hudson
2010-04-30 00:43:04 UTC
Permalink
profile noprefix
listc
--- sys2.fortlib is not in the list.

So all this time I have been trying to compile I did not have a sys2.fortlib


I checked my 'mylib' deck and found it did not mention sys2, so I fixed that
and ran
it again - now it basically says there is no sys2.fortlib to put the irand
member into

---
Post by Ron Hudson
Post by Ron Hudson
Post by Mike Schwab
//ddname DD DSN=SYS2.FORTLIB,DISP=SHR
// DD DSN=SYS1.FORTLIB, DISP=SHR
//GRID JOB CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=HUDSON
//FORT EXEC FORTHCLG,REGION.FORT=384K
//FORT.SYSLIN DD UNIT=SYSDA
//FORT.SYSABEND DD SYSOUT=A
//FORT.SYSIN DD *
C 34567
DIMENSION IGRID(40,40)
.
. fortran program here
.
END
//
//LKED.SYSLIB DD DSN=SYS2.FORTLIB,DISP=SHR,
// DD DSN=SYS1.FORTLIB,DISP=SHR
I am using the built in 'forthclg' (fortran h link and go) procedure.
so I think "fort.syslin" overrides the "syslin" line in the procedure - So
I thought I had to override the 'syslib' lines..
oops, I suppose I should say that the link step in forthclg still does not
seem to see sys2.fortlib
From the listing It looks like the override is not hapening...
Also is there a way to tell if SYS2.FORTLIB(IRAND) was properly formed?
What do I do with the DDNAME item?
Gerhard Postpischil
2010-04-30 02:30:17 UTC
Permalink
Post by Ron Hudson
. fortran program here
.
END
//
//LKED.SYSLIB DD DSN=SYS2.FORTLIB,DISP=SHR,
// DD DSN=SYS1.FORTLIB,DISP=SHR
The // without anything else is an end of job card - the system
never sees the SYSLIBs. For end of data set, use /* or omit it
if a JCL card follows it (the /* is generated by the system in
that case).



Gerhard Postpischil
Bradford, VT
Ron Hudson
2010-04-30 02:45:36 UTC
Permalink
On Thu, Apr 29, 2010 at 7:30 PM, Gerhard Postpischil
Post by Gerhard Postpischil
The // without anything else is an end of job card
I think I found that one - here is the current state of my deck:

//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)
INTEGER IY
IY = IABS(MOD(31421 * ISEED + 6927,2**15))
IRND = IY
RETURN
END
//LKED EXEC PGM=IEWL,PARM='LIST,LET,NCAL,MAP'
//SYSPRINT DD SYSOUT=A
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),UNIT=SYSDA,DISP=(NEW,KEEP)
//SYSUT1 DD UNIT=SYSALLDA,SPACE=(TRK,(15,15))
//SYSLIN DD DSN=MYLIB,DISP=(OLD,DELETE)
//

My current problem is the link step never happens because the system is
unhappy about not having a sys2.fortlib to put the IRND member in..

I even tried saying its "New" The last error pointed to a space parameter
but I don't know what to put.

Ron
Ron Hudson
2010-04-30 03:19:38 UTC
Permalink
even adding a space parameter - still no sys2.fortlib shows in listcat (no
prefix)

: ^ |
Post by Ron Hudson
Post by Gerhard Postpischil
The // without anything else is an end of job card
//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)
INTEGER IY
IY = IABS(MOD(31421 * ISEED + 6927,2**15))
IRND = IY
RETURN
END
//LKED EXEC PGM=IEWL,PARM='LIST,LET,NCAL,MAP'
//SYSPRINT DD SYSOUT=A
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),UNIT=SYSDA,DISP=(NEW,KEEP)
//SYSUT1 DD UNIT=SYSALLDA,SPACE=(TRK,(15,15))
//SYSLIN DD DSN=MYLIB,DISP=(OLD,DELETE)
//
My current problem is the link step never happens because the system is
unhappy about not having a sys2.fortlib to put the IRND member in..
I even tried saying its "New" The last error pointed to a space parameter
but I don't know what to put.
Ron
Ron Hudson
2010-04-30 04:15:35 UTC
Permalink
Ok. Now it has begun working...

I changed the Disp=(new,catlg) for sys2.fortlib and now I have a
sys2.fortlib

I compiled and it worked and I verifed that irnd() was not in sys1.fortlib

Are there any other functions/subprograms I should think about?

: ^ ) (remember our wiki)
Post by Ron Hudson
even adding a space parameter - still no sys2.fortlib shows in listcat (no
prefix)
: ^ |
On Thu, Apr 29, 2010 at 7:30 PM, Gerhard Postpischil <
Post by Gerhard Postpischil
The // without anything else is an end of job card
//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)
INTEGER IY
IY = IABS(MOD(31421 * ISEED + 6927,2**15))
IRND = IY
RETURN
END
//LKED EXEC PGM=IEWL,PARM='LIST,LET,NCAL,MAP'
//SYSPRINT DD SYSOUT=A
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),UNIT=SYSDA,DISP=(NEW,KEEP)
//SYSUT1 DD UNIT=SYSALLDA,SPACE=(TRK,(15,15))
//SYSLIN DD DSN=MYLIB,DISP=(OLD,DELETE)
//
My current problem is the link step never happens because the system is
unhappy about not having a sys2.fortlib to put the IRND member in..
I even tried saying its "New" The last error pointed to a space parameter
but I don't know what to put.
Ron
cedarlakebuzzards
2010-04-30 04:15:28 UTC
Permalink
Post by Ron Hudson
even adding a space parameter - still no sys2.fortlib shows in listcat (no
prefix)
: ^ |
Post by Ron Hudson
Post by Gerhard Postpischil
The // without anything else is an end of job card
//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)
INTEGER IY
IY = IABS(MOD(31421 * ISEED + 6927,2**15))
IRND = IY
RETURN
END
//LKED EXEC PGM=IEWL,PARM='LIST,LET,NCAL,MAP'
//SYSPRINT DD SYSOUT=A
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),UNIT=SYSDA,DISP=(NEW,KEEP)
//SYSUT1 DD UNIT=SYSALLDA,SPACE=(TRK,(15,15))
//SYSLIN DD DSN=MYLIB,DISP=(OLD,DELETE)
//
My current problem is the link step never happens because the system is
unhappy about not having a sys2.fortlib to put the IRND member in..
I even tried saying its "New" The last error pointed to a space parameter
but I don't know what to put.
Ron
Whenever you create a new dataset, you must specify the space parameter
and DCB. The general format is
SPACE=(type,(pri,sec,dir))
where
type is basic DASD allocations - TRKS, CYLS, or blocksize
pri is the primary number of 'types' to allocation
sec is the secondary number of 'types' to allocate if the primary space
fills up
dir is the number of directory blocks to allocate for the PDS.

My suggestion to you is to set up your SYSLMOD like this:
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),DISP=(NEW,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(1,1,1)),DCB=(RECFM=U,BLKSIZE=1024)

This will create a cataloged dataset SYS2.FORTLIB with member name IRND.
One track and one directory block will be allocated for the dataset.

Also, get rid of the blank lines of make the comments with //* in cols
1-3

Ed
Ron Hudson
2010-04-30 04:31:35 UTC
Permalink
On Thu, Apr 29, 2010 at 9:15 PM, cedarlakebuzzards <
Post by Ron Hudson
Post by Ron Hudson
even adding a space parameter - still no sys2.fortlib shows in listcat
(no
Post by Ron Hudson
prefix)
: ^ |
Post by Gerhard Postpischil
The // without anything else is an end of job card
//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)
INTEGER IY
IY = IABS(MOD(31421 * ISEED + 6927,2**15))
IRND = IY
RETURN
END
//LKED EXEC PGM=IEWL,PARM='LIST,LET,NCAL,MAP'
//SYSPRINT DD SYSOUT=A
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),UNIT=SYSDA,DISP=(NEW,KEEP)
//SYSUT1 DD UNIT=SYSALLDA,SPACE=(TRK,(15,15))
//SYSLIN DD DSN=MYLIB,DISP=(OLD,DELETE)
//
My current problem is the link step never happens because the system is
unhappy about not having a sys2.fortlib to put the IRND member in..
I even tried saying its "New" The last error pointed to a space
parameter
Post by Ron Hudson
but I don't know what to put.
Ron
Whenever you *create a new* dataset, you must specify the space parameter
and DCB. The general format is
SPACE=(type,(pri,sec,dir))
where
type is basic DASD allocations - TRKS, CYLS, or blocksize
pri is the primary number of 'types' to allocation
sec is the secondary number of 'types' to allocate if the primary space
fills up
dir is the number of directory blocks to allocate for the PDS.
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),DISP=(NEW,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(1,1,1)),DCB=(RECFM=U,BLKSIZE=1024)
I did not have a DCB parameter - what is that good for. My track sizes were
somewhat
larger.
Post by Ron Hudson
This will create a cataloged dataset SYS2.FORTLIB with member name IRND.
One track and one directory block will be allocated for the dataset.
Also, get rid of the blank lines of make the comments with //* in cols 1-3
I think the blank lines may be because of line folding in the email... see
the wiki.
Ron.
Post by Ron Hudson
Ed
Ron Hudson
2010-04-30 04:34:33 UTC
Permalink
On Thu, Apr 29, 2010 at 9:15 PM, cedarlakebuzzards <
cedarlakebuzzards-/***@public.gmane.org> wrote:
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),DISP=(NEW,CATLG),
Post by cedarlakebuzzards
// UNIT=SYSDA,SPACE=(TRK,(1,1,1)),DCB=(RECFM=U,BLKSIZE=1024)
oh, wouldn't that also mean that the resulting PDS could only have 5
members?
( or is that tracks > blocks and members are 5 to a block..)

Ron
Gerhard Postpischil
2010-04-30 08:40:44 UTC
Permalink
Post by cedarlakebuzzards
// UNIT=SYSDA,SPACE=(TRK,(1,1,1)),DCB=(RECFM=U,BLKSIZE=1024)
oh, wouldn't that also mean that the resulting PDS could only have 5
members?
( or is that tracks > blocks and members are 5 to a block..)
Yes. The third value is number of blocks, which gives you on
average about 4 members per block for a load module, and
slightly more for source. The suggested space is adequate for
the single module you were storing. If you will be testing and
replacing modules, I'd suggest using SPACE=(CYL,(1,1,20)), which
should suffice for a while - then you'll learn how to compress a
PDS, allowing space to be reused. (Note that you'll need to
delete and uncatalog the smaller instance before allocating the
new one).

The DCB parameter is used to let the system and programs know
what the format of the data is. For instance, compiler SYSIN
data sets are "card" format RECFM=FB, LRECL=80, and the BLKSIZE
is a multiple of 80 that's device dependent. For listings, IBM
generally uses RECFM=FBA, LRECL=121, where the A means that each
line has an ANSI carriage control (1=new page, blank=single
space, 2=double space, minus=triple space, +=overprint); JES2
printer length is 133. The DCB values, except block size, are
fixed, and documented in the appropriate compiler's Programmer
Reference manual, in the Utilities manual, and generally in the
documentation describing a program. If your data and the program
don't match, you may get incorrect output, or an error message,
or abnormal termination.

Load module libraries are a special case - if you allocate the
PDS without DCB parameters, the linkage editor will supply them.
For general use and reduction of device dependence, I would
suggest BLKSIZE=6144, as the 1024 size wastes an awful lot of
disk space.

Gerhard Postpischil
Bradford, VT
Ron Hudson
2010-04-30 13:26:29 UTC
Permalink
On Fri, Apr 30, 2010 at 1:40 AM, Gerhard Postpischil
Post by Gerhard Postpischil
// UNIT=SYSDA,SPACE=(TRK,(1,1,1)),DCB=(RECFM=U,BLKSIZE=1024)
oh, wouldn't that also mean that the resulting PDS could only have 5
members?
( or is that tracks > blocks and members are 5 to a block..)
Yes. The third value is number of blocks, which gives you on
average about 4 members per block for a load module, and
slightly more for source. The suggested space is adequate for
the single module you were storing.
Actually I intend to add other modules, as I think of them...
Rick Fochtman
2010-04-30 16:30:34 UTC
Permalink
----------------------------------------<snip>----------------------------------
.....For listings, IBM generally uses RECFM=FBA, LRECL=121, where the A
means that each line has an ANSI carriage control (1=new page,
blank=single space, 2=double space, minus=triple space, +=overprint);
---------------------------------------<unsnip>--------------------------------
No, a ZERO is double-space. A TWO is a skip-to-channel-two in the
carriage tape. Let's not go into carriage tapes and channels skips. :-)

Rick
Gerhard Postpischil
2010-04-30 20:02:22 UTC
Permalink
Post by Rick Fochtman
----------------------------------------<snip>----------------------------------
.....For listings, IBM generally uses RECFM=FBA, LRECL=121, where the A
means that each line has an ANSI carriage control (1=new page,
blank=single space, 2=double space, minus=triple space, +=overprint);
---------------------------------------<unsnip>--------------------------------
No, a ZERO is double-space. A TWO is a skip-to-channel-two in the
carriage tape. Let's not go into carriage tapes and channels skips. :-)
I'm horribly embarrassed, since I know better. Don't know what
it is about late night e-mail.


Gerhard Postpischil
Bradford, VT

Rick Fochtman
2010-04-30 16:27:00 UTC
Permalink
-----------------------------<snip>-----------------------------------
Post by Ron Hudson
On Thu, Apr 29, 2010 at 9:15 PM, cedarlakebuzzards
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),DISP=(NEW,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(1,1,1)),DCB=(RECFM=U,BLKSIZE=1024)
oh, wouldn't that also mean that the resulting PDS could only have 5
members?
( or is that tracks > blocks and members are 5 to a block..)
------------------------<unsnip>-------------------------------
You will probably get only one member in this space. Member NAMES are
about 5 to a DIRECTORY block. The actual member text records are stored
AFTER the directory in a PDS.

Rick
Rick Fochtman
2010-04-30 16:22:46 UTC
Permalink
-----------------------------<snip>------------------------------------
Post by Ron Hudson
//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)
INTEGER IY
IY = IABS(MOD(31421 * ISEED + 6927,2**15))
IRND = IY
RETURN
END
//LKED EXEC PGM=IEWL,PARM='LIST,LET,NCAL,MAP'
//SYSPRINT DD SYSOUT=A
//SYSLMOD DD DSN=SYS2.FORTLIB(IRND),UNIT=SYSDA,DISP=(NEW,KEEP)
//SYSUT1 DD UNIT=SYSALLDA,SPACE=(TRK,(15,15))
//SYSLIN DD DSN=MYLIB,DISP=(OLD,DELETE)
//
My current problem is the link step never happens because the system is
unhappy about not having a sys2.fortlib to put the IRND member in..
I even tried saying its "New" The last error pointed to a space
parameter but I don't know what to put.
---------------------------<unsnip>-----------------------------------
To create a SYS2.FORTLIB dataset:

// job statement
// EXEC PGM=IEFBR14
//NEWDATA DD DSN=SYS2.FORTLIB,DISP=(,CATLG),UNIT=SYSDA,
// VOL=SER=(whatever you choose),SPACE=(CYL,(10,10,90)),
// DCB=SYS1.FORTLIB

Then go back to your JCL and delete the EXEC PGM=IEWL card, the
SYSPRINT, the SYSUT1. Change SYSLMOD to LKED.SYSLMOD and SYSLIN to
LKED.SYSLIN

Find A JCL REFERENCE manual and look at the DD statement parameters. If
I get time I'll send you some excerpts from the z/OS JCL Reference that
might also be helpful.

Rick
Rick Fochtman
2010-04-30 16:07:58 UTC
Permalink
-----------------------------------<snip>----------------------------
Post by Mike Schwab
//ddname DD DSN=SYS2.FORTLIB,DISP=SHR
// DD DSN=SYS1.FORTLIB, DISP=SHR
//GRID JOB CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=HUDSON
//FORT EXEC FORTHCLG,REGION.FORT=384K
//FORT.SYSLIN DD UNIT=SYSDA
//FORT.SYSABEND DD SYSOUT=A
//FORT.SYSIN DD *
C 34567
DIMENSION IGRID(40,40)
.
. fortran program here
.
END
// <---This ends the
job. Get rid of it.
//LKED.SYSLIB DD DSN=SYS2.FORTLIB,DISP=SHR,
// DD DSN=SYS1.FORTLIB,DISP=SHR
I am using the built in 'forthclg' (fortran h link and go) procedure.
so I think "fort.syslin" overrides the "syslin" line in the procedure - So
I thought I had to override the 'syslib' lines..
------------------------------------<unsnip>-----------------------------------
See note above.

Rick
Rick Fochtman
2010-04-30 16:05:17 UTC
Permalink
---------------------------------<snip>-----------------------------------
Post by Ron Hudson
1) now how do I remove the old one from SYS1.FORTLIB ?
You can do it interactively from TSO (my preference), or using IBM
utilities and JCL (which I don't know what the magic incantaion is ... I
think you can use either IDCAMS with DELETE statements or just

IEBFR14 (the dummy program), with MOD,DELETE or some such in the DISP
parameter.
--------------------------------------<unsnip>------------------------------------
NO NO NO NO NO

IEFBR14 will delete the entire dataset, not just the member!! A very
common "newbie" mistake!

Look at my previous post for the magic incantation for the proper batch
utility.

IDCAMS in MVS 3.8J did NOT have member delete functions. It can,
howwever, be very dangerous as it might delete the entire dataset.

Rick
Rick Fochtman
2010-04-30 15:58:34 UTC
Permalink
------------------------------------<snip>-------------------------------
Post by Rick Fochtman
You might want to build a separate library for your additions; in
my own way of thinking, I'd call it "SYS2.FORTLIB" and add it to
the SYSLIB concatenation in any LINKEDIT or LOADER steps in my
FORTRAN procs. That might be helpful in separating your routines
from the IBM-supplied library.
Ok, I changed the JCL line to read SYS2.FORTLIB and it said that "****
IRND now replaced in data set"
1) now how do I remove the old one from SYS1.FORTLIB ?
----------------------------<unsnip>--------------------------------------
To remove from SYS1.FORTLIB:

// job statement
// EXEC PGM=IEHPROGM
//SYSPRINT DD SYSOUT=A
//DISK DD DISP=SHR,UNIT=SYSDA,VOL=SER= (The volume containing
SYS1.FORTLIB )
//SYSIN DD *
SCRATCH MEMBER=IRND,VOL=3330= (same volser),DSNAME=SYS1.FORTLIB
//

This assumes that the devtype is a 3330; replace with proper type as needed.

For safety's sake, ALWAYS put the member name FIRST in the control
statements for this utility. A missing comma can lead to disastrous
results if you change the order.

------------------------------------<snip>-------------------------------------
Post by Rick Fochtman
2) what do I do to use it in it's new place?
-------------------<unsnip>---------------------------------------------

In any LINKEDIT or LOADER step that refers to SYS1.FORTLIB
Replace:

//SYSLIB DD DSN=SYS1.FORTLIB,DISP=SHR

With

//SYSLIB DD DSN=SYS1.FORTLIB,DISP=SHR
// DD DSN=SYS2.FORTLIB,DISP=SHR


This is called CONCATENATION of LIBRARIES and is quite a common practice
in MVS, OS/360 and all the successor systems. The limit for this is 255
total disk extents.

I don't object to off-list contact for this sort of thing.

Rick
John R. Macdonald
2010-04-30 02:00:10 UTC
Permalink
-----Original Message-----
From: turnkey-mvs-***@public.gmane.org [mailto:turnkey-mvs-***@public.gmane.org] On
Behalf Of Rick Fochtman
Sent: jeudi 29 avril 2010 20:19
To: turnkey-mvs-***@public.gmane.org
Subject: Re: [turnkey-mvs] Anyone need a random number generator?




------------------------------<snip>---------------------------------------



On Wed, Apr 28, 2010 at 12:39 PM, Rick Fochtman <***@ync.
<mailto:rfochtman-***@public.gmane.org> net> wrote:



//SYSLMOD DD DSN=SYS1,FORTLIB(IRND),DISP=SHR <-- member name is LMOD name
when link is complete


-----------------------------------------------------------^^^^^

Rick
<mailto:hudson.ra-***@public.gmane.org?subject=Anyone%20need%20a%20random%20number%20ge
nerator?>
<mailto:turnkey-mvs-***@public.gmane.org?subject=Anyone%20need%20a%20random%20num
ber%20generator?>
<http://groups.yahoo.com/group/turnkey-mvs/post;_ylc=X3oDMTJwYjNyZWxhBF9TAzk
3MzU5NzE0BGdycElkAzgxNjExNjIEZ3Jwc3BJZAMxNzA1MDA2NTU5BG1zZ0lkAzY1MzQEc2VjA2Z
0cgRzbGsDcnBseQRzdGltZQMxMjcyNDcyNDYz?act=reply&messageNum=6534>




If I wanted to add other subroutines or functions to the source code would
that be ok too?

or should I duplicate this whole file and change names?


---------------------------------<unsnip>------------------------------
You might want to build a separate library for your additions; in my own way
of thinking, I'd call it "SYS2.FORTLIB" and add it to the SYSLIB
concatenation in any LINKEDIT or LOADER steps in my FORTRAN procs. That
might be helpful in separating your routines from the IBM-supplied library.

Rick






Ron

In addition to building a separate library for your user stuff IMHO you
would be better off by having a separate module for each subroutine or
function you require.
Puting it all in one module will :
- limit you to a maximum of 16 functions (1 main entry point + 15 aliases
for the secondary EPs IIRC) per module (which also means that if you write
more than 16 routines you'll have to remember in which
module a particular function is)
- increase the size of the final load module beyond what is really necessary
- increase the size and complexity of the source code
- introduce the possibility of accidentally clobbering perfectly good code
in function B while adding/modifying function C then spend hours trying to
figure out what happened
- in the same vein introduce subtle side effects between two or more
functions
I haven't coded in FORTRAN so I don't how easy/difficult it is to code
secondary entry points for this FORTRAN compiler (I have done it in COBOL &
PL/I though, which is how I found out about the 16 EPs limitation)
HTH
John
Ron Hudson
2010-04-30 02:13:02 UTC
Permalink
Post by John R. Macdonald
Ron
In addition to building a separate library for your user stuff IMHO you
would be better off by having a separate module for each subroutine or
function you require.
Yeah, besides I now (almost) have the tech to have a sys2.fortlib where the
individual functions are in members.. that means I only link in the ones
called for.

Ron.
Loading...