Re: How to read source from a PDS member

2007-10-22 Thread Gerhard Postpischil

Robert A. Rosenberg wrote:
The advantage is that you know when you reach the end of a member as 
opposed to seeing the concatenation as one large file/member (although I 
have a vague impression that there is an exit than can be driven [if 
defined in the exitlist to the DCB] when you do the DD switch so you can 
know when you switch members).


The exit you're thinking of is the Open exit. When the unlike 
concatenation flag is set, it will be entered for each DD.


Gerhard Postpischil
Bradford, VT

new e-mail address: gerhardp (at) charter (dot) net

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-22 Thread J R
 The exit you're thinking of is the Open exit. When the unlike  
 concatenation flag is set, it will be entered for each DD.
Or the EOV exit for that matter.  
 Date: Mon, 22 Oct 2007 11:05:02 -0400 From: [EMAIL PROTECTED] Subject: Re: 
 How to read source from a PDS member To: IBM-MAIN@BAMA.UA.EDU  Robert A. 
 Rosenberg wrote:  The advantage is that you know when you reach the end of 
 a member as   opposed to seeing the concatenation as one large file/member 
 (although I   have a vague impression that there is an exit than can be 
 driven [if   defined in the exitlist to the DCB] when you do the DD switch 
 so you can   know when you switch members).  The exit you're thinking of 
 is the Open exit. When the unlike  concatenation flag is set, it will be 
 entered for each DD.  Gerhard Postpischil Bradford, VT
_
Peek-a-boo FREE Tricks  Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHMloc=us
--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-22 Thread J R
 The exit you're thinking of is the Open exit. When the unlike  
 concatenation flag is set, it will be entered for each DD.
Or the EOV exit for that matter.  In fact, I believe that EOV is better because 
it does not incur CLOSE/OPEN which unlike concatenation does.  
 Date: Mon, 22 Oct 2007 11:05:02 -0400 From: [EMAIL PROTECTED] Subject: Re: 
 How to read source from a PDS member To: IBM-MAIN@BAMA.UA.EDU  Robert A. 
 Rosenberg wrote:  The advantage is that you know when you reach the end of 
 a member as   opposed to seeing the concatenation as one large file/member 
 (although I   have a vague impression that there is an exit than can be 
 driven [if   defined in the exitlist to the DCB] when you do the DD switch 
 so you can   know when you switch members).  The exit you're thinking of 
 is the Open exit. When the unlike  concatenation flag is set, it will be 
 entered for each DD.  Gerhard Postpischil Bradford, VT
_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-22 Thread GAVIN Darren * OPS EAS
I thought of that, it's not available in our release of LE.  We are
still on zOS 1.4 with Cobol LE 2.2.1.  (we are upgrading but that's
taking time)

TSO seemed the cleaner solution over the GETENV and PUTENV routines of
C.

Darren

-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Kenneth E Tomiak
Sent: Sunday, October 21, 2007 8:47 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: How to read source from a PDS member

Use the Language Environment routine to dynamically allocate the dataset
(member) and skip having to run TSO. Puts the program name you are 
executing back in the JCL. Now if only DB2 would get smarter. Although,
if you 
work at, even your DB2 programs can be run from the EXEC PGM= JCL 
statement.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-21 Thread Kenneth E Tomiak
Use the Language Environment routine to dynamically allocate the dataset
(member) and skip having to run TSO. Puts the program name you are 
executing back in the JCL. Now if only DB2 would get smarter. Although, if you 
work at, even your DB2 programs can be run from the EXEC PGM= JCL 
statement.

On Fri, 19 Oct 2007 08:24:40 -0700, GAVIN Darren * OPS EAS 
[EMAIL PROTECTED] wrote:
The Program needs to run under batch TSO services similar to a DB2
program

//STEP010 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSTSIN  DD *
 CALL *(MYPROG)


Hope this helps,

Darren


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-21 Thread Robert A. Rosenberg
At 21:48 -0500 on 10/18/2007, Tom Schmidt wrote about Re: How to read 
source from a PDS member:



Furthermore, OPEN-J has a different path length than traditional OPEN.  Run a
few benchmarks.


OPEN-J (and its companion RDJFCB) are the simplest solution in my 
opinion if you are using ALC and QSAM. They allow you to act as if 
the DD was of the form DSN=DATASET(MEMBER) and allow you to read 
multiple members as if you had separate DDs and altered the DDN 
pointer in the DCB between members. The swap is done by doing a 
CLOSE, altering the Member Name in the in memory JFCB, and then doing 
another OPEN-J (the single RFJCFB gets the JFCB into memory and you 
then do a Update Member Name, OPEN-J, GETs, CLOSE loop for each 
member).


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-21 Thread Robert A. Rosenberg
At 09:17 -0400 on 10/20/2007, Warner Mach wrote about Re: How to read 
source from a PDS member:



When I read this I thought it was pretty neat. Never had occurred to
me that this was possible ... It is still neat to know. However, as a
practical matter I could not think of an instance where it would be
preferable to simply concatenating the data sets:

//SYSLIB  DD  DISP=SHR,DSN=USERS.INPUT(TABLEX)
//DD  DISP=SHR,DSN=USERS.INPUT(TABLEY)
//DD  DISP=SHR,DSN=USERT.MUMBLE(TABLEZ)

Only need one open and close.


The advantage is that you know when you reach the end of a member as 
opposed to seeing the concatenation as one large file/member 
(although I have a vague impression that there is an exit than can be 
driven [if defined in the exitlist to the DCB] when you do the DD 
switch so you can know when you switch members).


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-20 Thread Warner Mach
On Oct 18 Tom Schmidt wrote:
You might have overlooked an interesting gem of a feature of z/OS JCL: 
FREE=CLOSE.

If you need to provide several alternative tables, you might be able to
 do so 
strictly in the enveloping JCL by doing something like this:

//SYSLIB  DD  DISP=SHR,FREE=CLOSE,DSN=USERS.INPUT(TABLEX)
//SYSLIB  DD  DISP=SHR,FREE=CLOSE,DSN=USERS.INPUT(TABLEY)
//SYSLIB  DD  DISP=SHR,FREE=CLOSE,DSN=USERT.MUMBLE(TABLEZ)

Note that the DDNAME is replicated three (3) times above, for example.
  
 
For the cost of a full OPEN/GET/CLOSE you get to read the record from
 the 
first member and be positioned to the second member on your next 
OPEN/GET/CLOSE.  Not high performance but pretty high function and very
 
easy to maintain (just change the JCL).  
 
z/OS does not limit DDNAMES to a single appearance in a step (although
 you'd 
be surprised how many think otherwise).  By crafty use of multiple DDs
 with 
identical names that resolve to different datasets (even to completely 
different data set names).  Since any DD can use traditional data sets
 or 
PATH= it is also quite general.  
 
Nearly every high level language supports file opens and closes so
 nearly every 
high level language can perform this trick.  
 
All you need to do is stop looping through the open/close once the open
 fails.  
(You ought to provide for error recovery if the open fails anyway so
 that might 
not be asking too much.)  
/snip
When I read this I thought it was pretty neat. Never had occurred to
me that this was possible ... It is still neat to know. However, as a
practical matter I could not think of an instance where it would be 
preferable to simply concatenating the data sets:

//SYSLIB  DD  DISP=SHR,DSN=USERS.INPUT(TABLEX)
//DD  DISP=SHR,DSN=USERS.INPUT(TABLEY)
//DD  DISP=SHR,DSN=USERT.MUMBLE(TABLEZ)

Only need one open and close.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-20 Thread Paul Gilmartin
On Sat, 20 Oct 2007 09:17:16 -0400, Warner Mach wrote:

z/OS does not limit DDNAMES to a single appearance in a step (although you'd
be surprised how many think otherwise).

FSVO z/OS.  I can readily cause a failure with:

14:44:15 IAT4410  DDNAME INPUTIS DUPLICATED WITHIN STEP
14:44:15 IAT4801 JOB JOBCARD  (JOB09982) EXPRESS CANCELED BY INTERPRETER DSP

I prefer this behavior by the way.  Tolerating duplicate DDNAMEs invites
undetected errors.  The behavior with referbacks is bizarre.  I can't
guess what happens with overrides.

...  By crafty use of multiple DDs with
identical names that resolve to different datasets (even to completely
different data set names).  Since any DD can use traditional data sets
 or PATH= it is also quite general.

It's surprising and dismaying how many z/OS utilities reject DD PATH=
for no reason beyond sheer bigotry.

When I read this I thought it was pretty neat. Never had occurred to
me that this was possible ... It is still neat to know. However, as a
practical matter I could not think of an instance where it would be
preferable to simply concatenating the data sets:

If you simply concatenate the data sets, how do you recognize the
boundaries between catenands?

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-19 Thread Rick Fochtman

-snip--

We've updated Harold's nice subroutine in order to be 31-bit compliant.  I will 
send you a copy if you like. 
 


unsnip
How about sending it to the CBT site and share with all comers?

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-19 Thread Harold Zbiegien

This is Harold,

Actually I did not write it, I just made a few corrections.
And I'm glad you took it and improved it even more.

I would suggest that you submit the update to www.cbttape.org so that others 
could similarly benefit from your enhancements.


- Original Message - 
From: Rich Szabo [EMAIL PROTECTED]

Newsgroups: bit.listserv.ibm-main
To: IBM-MAIN@BAMA.UA.EDU
Sent: Friday, October 19, 2007 8:06 AM
Subject: Re: How to read source from a PDS member


We've updated Harold's nice subroutine in order to be 31-bit compliant.  I 
will

send you a copy if you like.

Rich Szabo
State Auto Insurance

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-19 Thread GAVIN Darren * OPS EAS
I've done this buy using the 'OPTIONAL phrase on the file select in
Cobol, and then using TSO Allocate and Free commands from inside the
program itself.

The Program needs to Allocate, then OPEN, Read or Write, then Close,
then Free the file.  This can be repeated in a single run of the program
as many times as needed.

01  WS-DYNAMIC-ALLOCATIONS.   
05  WS-ALLOCATE.  
10  FILLER  PIC X(28) 
VALUE 'ALLOCATE F(JOBPROC) DSNAME('''.
10  FILLER  PIC X(20) 
VALUE 'SDEV.PROD.P.PROCLIB('. 
10  MEMBER-NAME PIC X(8) .
10  FILLER  PIC X(7)  
VALUE ')'') SHR'. 
05  WS-DEALLOCATE   PIC X(15) 
VALUE 'FREE F(JOBPROC)'.  

*   WORK AREA'S FOR TSO INTERFACING   
 01  TSO-LINKPIC X(8) VALUE 'TSOLNK'. 
 01  TSO-FLAGS   PIC S9(9) COMP VALUE 257.
 01  TSO-LENGTH  PIC S9(9) COMP VALUE 0.  
 01  TSO-RC  PIC S9(9) COMP VALUE 0.  
 01  TSO-REASON  PIC S9(9) COMP VALUE 0.  
 01  TSO-ABEND   PIC S9(9) COMP VALUE 0.  

/
* DYNAMICALY ALLOCATE FILE THROUGH TSO SERVICES  
*
 8000-TSO-ALLOCATE.  
 
 MOVE LENGTH OF WS-ALLOCATE TO TSO-LENGTH.   
 CALL TSO-LINK USING TSO-FLAGS WS-ALLOCATE TSO-LENGTH
 TSO-RC TSO-REASON TSO-ABEND.
 
 8000-EXIT. EXIT.
 
/
* DYNAMICALY DEALLOCATE FILE THROUGH TSO SERVICES
*
 8100-TSO-DEALLOCATE.
 
 MOVE LENGTH OF WS-DEALLOCATE TO TSO-LENGTH. 
 CALL TSO-LINK USING TSO-FLAGS WS-DEALLOCATE TSO-LENGTH  
 TSO-RC TSO-REASON TSO-ABEND.
 
 8100-EXIT. EXIT.


The Program needs to run under batch TSO services similar to a DB2
program

//STEP010 EXEC PGM=IKJEFT01  
//SYSTSPRT DD SYSOUT=*   
//SYSOUT   DD SYSOUT=*   
//SYSTSIN  DD *  
 CALL *(MYPROG)


Hope this helps,

Darren

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-19 Thread Binyamin Dissen
On Thu, 18 Oct 2007 20:42:28 -0400 Gerhard Postpischil [EMAIL PROTECTED]
wrote:

:Paul Gilmartin wrote:
: On Thu, 18 Oct 2007 17:27:02 +0200, Binyamin Dissen wrote:
: BPAM is not THAT unfriendly.

: If it truly were not THAT unfriendly you'd not have troubled
: to write a wrapper to hide the hostility from the programmer;
: nor would numerous other inventors who independently replicated
: your effort.

:I don't want to start a mud slinging contest, but the reason I 
:use macros and subroutines is to isolate my code from system 
:changes, and to free time to do useful work, rather than repeat 
:the same drudge work over and over. Thus over the decades, some 
:BPAM code has been replaced by DESERV, some LOCATE code by the 
:catalog interface, and OBTAIN SEEK/SEARCH by CVAF Functions, etc.

Or to perform common functions.

Who hasn't written parsing macros/subroutines, message builders, etc.?

--
Binyamin Dissen [EMAIL PROTECTED]
http://www.dissensoftware.com

Director, Dissen Software, Bar  Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-19 Thread Rich Szabo
We've updated Harold's nice subroutine in order to be 31-bit compliant.  I will 
send you a copy if you like.   

Rich Szabo
State Auto Insurance

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Howard Brazee
On Thu, 18 Oct 2007 09:43:51 -0400, in bit.listserv.ibm-main you
wrote:

I need to read source code from a PDS member whose name I don't know until my 
program runs, much the same as the COBOL 
compiler handles COPY memname statements.  Is dynalloc the only way to go 
about it or does zOS provide a nice friendly 
interface that lets me ask for source member data a line at a time?  Something 
comparable to VSE's LIBRM would be ideal.

CoBOL compilers handle COPY commands at compile time, not run time.
But you didn't indicate that your source code is CoBOL, it may be some
real-time language.Could you provide more detail?

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread McKown, John
 -Original Message-
 From: IBM Mainframe Discussion List 
 [mailto:[EMAIL PROTECTED] On Behalf Of Howard Brazee
 Sent: Thursday, October 18, 2007 9:22 AM
 To: IBM-MAIN@BAMA.UA.EDU
 Subject: Re: How to read source from a PDS member
 
 
 On Thu, 18 Oct 2007 09:43:51 -0400, in bit.listserv.ibm-main you
 wrote:
 
 I need to read source code from a PDS member whose name I 
 don't know until my program runs, much the same as the COBOL 
 compiler handles COPY memname statements.  Is dynalloc the 
 only way to go about it or does zOS provide a nice friendly 
 interface that lets me ask for source member data a line at 
 a time?  Something comparable to VSE's LIBRM would be ideal.
 

I didn't see the original post. What language? Enterprise COBOL makes
this very simple because it can hide the details of dynamic allocation
from the programmer. In Java, use JZOS and the zFile class to do all the
difficult work for you. In assembler, you use BPAM. That entails OPENing
the PDS as a PDS, doing a FIND for the member name, then doing a READ
for each physical block of the member. Deblocking into individual
records is done by the application program, not the access method. 

If you run your program under ISPF, then you can use the LM* services to
do all the fiddly work for you.

I don't know z/VSE, but I did a quick look at it. I don't know of
anything as nice and easy as that in z/OS.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Hare, Tim
How about just passing the member name as a parameter in a PROC?

//MYPGM  PROC MBR=NOMBR
//RUNIT  EXEC PGM=MYPGM
//INPUT   DD DISP=SHR,DSN=MY.PDS(MBR)



Tim Hare
Senior Systems Programmer
Florida Department of Transportation
Tel: +1 (850) 414-4209

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Itschak Mugzach
Do you REXX? This is the best language to deal with strings, allocations and
dynamic variables on the fly. It is also run natively under TSO (and TSO
batch) and thus, supports ALLOC commands. 

Itschak 

-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of Howard Brazee
Sent: Thursday, October 18, 2007 4:22 PM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: How to read source from a PDS member

On Thu, 18 Oct 2007 09:43:51 -0400, in bit.listserv.ibm-main you
wrote:

I need to read source code from a PDS member whose name I don't know 
until my program runs, much the same as the COBOL compiler handles 
COPY memname statements.  Is dynalloc the only way to go about it or does
zOS provide a nice friendly interface that lets me ask for source member
data a line at a time?  Something comparable to VSE's LIBRM would be ideal.

CoBOL compilers handle COPY commands at compile time, not run time.
But you didn't indicate that your source code is CoBOL, it may be some
real-time language.Could you provide more detail?

--
For IBM-MAIN subscribe / signoff / archive access instructions, send email
to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the
archives at http://bama.ua.edu/archives/ibm-main.html

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Thompson, Steve
-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Howard Brazee
Sent: Thursday, October 18, 2007 9:22 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: How to read source from a PDS member

On Thu, 18 Oct 2007 09:43:51 -0400, in bit.listserv.ibm-main you
wrote:

I need to read source code from a PDS member whose name I don't know 
until my program runs, much the same as the COBOL compiler handles 
COPY memname statements.  Is dynalloc the only way to go about it or
does zOS provide a nice friendly interface that lets me ask for source
member data a line at a time?  Something comparable to VSE's LIBRM would
be ideal.

CoBOL compilers handle COPY commands at compile time, not run time.
But you didn't indicate that your source code is CoBOL, it may be some
real-time language.Could you provide more detail?
snip

I didn't get the original message. 

But the question is, what language are you using, and how do you find
out what the member is that you need to read?

From this, a better answer can be given. If you are writing an ALC
program, you will need to start with BLDL and a DCB to match. Your DD
will have to point to the PDS (not member specific).

Regards,
Steve Thompson

-- Opinions expressed are my own. --

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Paul Gilmartin
On Thu, 18 Oct 2007 16:34:36 +0200, Itschak Mugzach wrote:

Do you REXX? This is the best language to deal with strings, allocations and
dynamic variables on the fly. It is also run natively under TSO (and TSO
batch) and thus, supports ALLOC commands.

And under IRXJCL and Unix System Services, as well as TSO and TSO batch,
BPXWDYN is available, which is in some respects superior to ALLOCATE;
in others inferior.

-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of Howard Brazee
Sent: Thursday, October 18, 2007 4:22 PM

On Thu, 18 Oct 2007 09:43:51 -0400, in bit.listserv.ibm-main you
wrote:

I need to read source code from a PDS member whose name I don't know
until my program runs, much the same as the COBOL compiler handles
COPY memname statements.  Is dynalloc the only way to go about it or does
zOS provide a nice friendly interface that lets me ask for source member
data a line at a time?  Something comparable to VSE's LIBRM would be ideal.

Dynalloc and reading records from the file are not alternatives to each
other; first you dynalloc, then you read.

Precious few languages support statically allocating a DDNAME to a
library then reading a selected member from that library, as:
open(DDNAME(MEMBER)); likely because that protocol is not well
supported by QSAM.

CoBOL compilers handle COPY commands at compile time, not run time.

So what's the point?  It demonstrates the basic feasibility of the
operation.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Chase, John
 -Original Message-
 From: IBM Mainframe Discussion List On Behalf Of Howard Brazee
 
 On Thu, 18 Oct 2007 09:43:51 -0400, in bit.listserv.ibm-main you
 wrote:
 
 I need to read source code from a PDS member whose name I don't know 
 until my program runs, much the same as the COBOL compiler handles 
 COPY memname statements.  Is dynalloc the only way to go 
 about it or does zOS provide a nice friendly interface that 
 lets me ask for source member data a line at a time?  
 Something comparable to VSE's LIBRM would be ideal.
 
 CoBOL compilers handle COPY commands at compile time, not run time.

But compile time *is* the run time of the compiler, which is doing the
COPYing..

-jc-

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Binyamin Dissen
On Thu, 18 Oct 2007 08:21:44 -0600 Howard Brazee [EMAIL PROTECTED] wrote:

:On Thu, 18 Oct 2007 09:43:51 -0400, in bit.listserv.ibm-main you
:wrote:

:I need to read source code from a PDS member whose name I don't know until 
my program runs, much the same as the COBOL 
:compiler handles COPY memname statements.  Is dynalloc the only way to go 
about it or does zOS provide a nice friendly 
:interface that lets me ask for source member data a line at a time?  
Something comparable to VSE's LIBRM would be ideal.

:CoBOL compilers handle COPY commands at compile time, not run time.
:But you didn't indicate that your source code is CoBOL, it may be some
:real-time language.Could you provide more detail?

BPAM is not THAT unfriendly.

A while back (probably before many lurkers on this list were born, but I
digress) I wrote a set of subroutines called QPAM to hide the tricky stuff
from the programmer (don't know if I can give it out).

QPAM GET   - get next record
QPAM PUT   - put a record
QPAM TRUNC - force a write of all queued blocks
QPAM RLSE  - stop reading current member

You still hard coded the FIND and STOW, but they are rather simple.

--
Binyamin Dissen [EMAIL PROTECTED]
http://www.dissensoftware.com

Director, Dissen Software, Bar  Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Tom Schmidt
On Thu, 18 Oct 2007 09:43:51 -0400, bit.listserv.ibm-main wrote:

I need to read source code from a PDS member whose name I don't know
until my program runs, much the same as the COBOL
compiler handles COPY memname statements.  Is dynalloc the only way to 
go about it or does zOS provide a nice friendly
interface that lets me ask for source member data a line at a time?  
Something comparable to VSE's LIBRM would be ideal.
 
 
z/OS has the venerable OPEN-J service that might be what you are looking for 
here.  Check the z/OS publications for the OPEN macro's TYPE=J operand.  
 
If you are looking from the perspective of a higher-level language such as C 
(although I might otherwise argue that point) then you can use BPXDYN 
service to switch both member name and dataset name.   

-- 
Tom Schmidt 
Madison, WI

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Harold Zbiegien

www.cbttape.org
there is a subroutine that is callable from Cobol that will let you read a 
member of a PDS


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Gerhard Postpischil

Paul Gilmartin wrote:

On Thu, 18 Oct 2007 17:27:02 +0200, Binyamin Dissen wrote:
BPAM is not THAT unfriendly.


If it truly were not THAT unfriendly you'd not have troubled
to write a wrapper to hide the hostility from the programmer;
nor would numerous other inventors who independently replicated
your effort.


I don't want to start a mud slinging contest, but the reason I 
use macros and subroutines is to isolate my code from system 
changes, and to free time to do useful work, rather than repeat 
the same drudge work over and over. Thus over the decades, some 
BPAM code has been replaced by DESERV, some LOCATE code by the 
catalog interface, and OBTAIN SEEK/SEARCH by CVAF Functions, etc.


Friendliness of a function becomes irrelevant when you work with 
it only once every few years.


Gerhard Postpischil
Bradford, VT

new e-mail address: gerhardp (at) charter (dot) net

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Paul Gilmartin
On Thu, 18 Oct 2007 17:27:02 +0200, Binyamin Dissen wrote:

BPAM is not THAT unfriendly.

If it truly were not THAT unfriendly you'd not have troubled
to write a wrapper to hide the hostility from the programmer;
nor would numerous other inventors who independently replicated
your effort.

A while back (probably before many lurkers on this list were born, but I
digress) I wrote a set of subroutines called QPAM to hide the tricky stuff
from the programmer (don't know if I can give it out).

QPAM GET   - get next record
QPAM PUT   - put a record
QPAM TRUNC - force a write of all queued blocks
QPAM RLSE  - stop reading current member

You still hard coded the FIND and STOW, but they are rather simple.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Paul Gilmartin
On Thu, 18 Oct 2007 11:24:19 -0500, Tom Schmidt wrote:

z/OS has the venerable OPEN-J service that might be what you are looking for
here.  Check the z/OS publications for the OPEN macro's TYPE=J operand.

Those fixated on performance will object to performing an OPEN
for each member rather than a single OPEN and multiple FINDs.

If you are looking from the perspective of a higher-level language such as C
(although I might otherwise argue that point) then you can use BPXDYN
service to switch both member name and dataset name.

Ah, I forgot; as you note BPXWDYN also has a CALL interface (and
in one convoluted case I encountered TSO's 100-character PARM
limit; I resorted to several ALLOCATEs and a BPXWDYN CONCAT).
But it isn't suited to the task of accessing various members from
a given DDNAME (Suppose the DDNAME is a mixed concatenation of
PDS[E]s and HFS directories).

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Tom Schmidt
On Thu, 18 Oct 2007 18:24:12 -0500, Paul Gilmartin wrote:

On Thu, 18 Oct 2007 11:24:19 -0500, Tom Schmidt wrote:

z/OS has the venerable OPEN-J service that might be what you are looking 
for
here.  Check the z/OS publications for the OPEN macro's TYPE=J operand.

Those fixated on performance will object to performing an OPEN
for each member rather than a single OPEN and multiple FINDs.
 
 
OP did not state any performance requirements; he was interested only in 
alternatives to DYNALLOC.  I provided him with one.  
  
Furthermore, OPEN-J has a different path length than traditional OPEN.  Run a 
few benchmarks.  
 
I agree with you  others that BPAM is yet another possible alternative for OP 
to consider.  
 
Different strokes for different folks.  
 
-- 
Tom Schmidt 
Madison, WI

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to read source from a PDS member

2007-10-18 Thread Tom Schmidt
John/OP:

You might have overlooked an interesting gem of a feature of z/OS JCL: 
FREE=CLOSE.

If you need to provide several alternative tables, you might be able to do so 
strictly in the enveloping JCL by doing something like this:

//SYSLIB  DD  DISP=SHR,FREE=CLOSE,DSN=USERS.INPUT(TABLEX)
//SYSLIB  DD  DISP=SHR,FREE=CLOSE,DSN=USERS.INPUT(TABLEY)
//SYSLIB  DD  DISP=SHR,FREE=CLOSE,DSN=USERT.MUMBLE(TABLEZ)

Note that the DDNAME is replicated three (3) times above, for example.  
 
For the cost of a full OPEN/GET/CLOSE you get to read the record from the 
first member and be positioned to the second member on your next 
OPEN/GET/CLOSE.  Not high performance but pretty high function and very 
easy to maintain (just change the JCL).  
 
z/OS does not limit DDNAMES to a single appearance in a step (although you'd 
be surprised how many think otherwise).  By crafty use of multiple DDs with 
identical names that resolve to different datasets (even to completely 
different data set names).  Since any DD can use traditional data sets or 
PATH= it is also quite general.  
 
Nearly every high level language supports file opens and closes so nearly every 
high level language can perform this trick.  
 
All you need to do is stop looping through the open/close once the open fails.  
(You ought to provide for error recovery if the open fails anyway so that might 
not be asking too much.)  

-- 
Tom Schmidt 
Madison, WI

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html