Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-05-02 Thread Charles Mills
Full samples of deblocking BPAM directory blocks with code? Which program?

I don't see any examples in the P/G you linked to either. What am I missing?

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf
Of David Crayford
Sent: Tuesday, May 01, 2012 8:20 PM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

The book also has examples and you will find full samples in the SCBCSAMP
data set.

http://publib.boulder.ibm.com/infocenter/zvm/v5r4/index.jsp?topic=/com.ibm.z
os.r9.cbcpx01/cbcpg18096.htm

On 2/05/2012 9:58 AM, Charles Mills wrote:
 Thanks!

 Charles

 -Original Message-
 From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On 
 Behalf Of Bernd Oppolzer
 Sent: Tuesday, May 01, 2012 6:09 PM
 To: IBM-MAIN@bama.ua.edu
 Subject: Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

 Thank you!

 Here is an excerpt of a C program which reads a directory of a PDS and 
 inserts the member names into an AVL tree (the insert is not shown, it 
 is done by a function call - see below).

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-05-02 Thread David Crayford
My link was bad! Seems I didn't quite understand how to copy a link in 
Infocenter!


http://publib.boulder.ibm.com/infocenter/zvm/v5r4/topic/com.ibm.zos.r9.cbcpx01/cbcpg180781.htm#wq1935

On 3/05/2012 1:09 AM, Charles Mills wrote:

Full samples of deblocking BPAM directory blocks with code? Which program?

I don't see any examples in the P/G you linked to either. What am I missing?

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf
Of David Crayford
Sent: Tuesday, May 01, 2012 8:20 PM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

The book also has examples and you will find full samples in the SCBCSAMP
data set.

http://publib.boulder.ibm.com/infocenter/zvm/v5r4/index.jsp?topic=/com.ibm.z
os.r9.cbcpx01/cbcpg18096.htm

On 2/05/2012 9:58 AM, Charles Mills wrote:

Thanks!

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On
Behalf Of Bernd Oppolzer
Sent: Tuesday, May 01, 2012 6:09 PM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

Thank you!

Here is an excerpt of a C program which reads a directory of a PDS and
inserts the member names into an AVL tree (the insert is not shown, it
is done by a function call - see below).

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-05-02 Thread Charles Mills
Aha! Muchas gracias!

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf
Of David Crayford
Sent: Wednesday, May 02, 2012 7:37 PM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

My link was bad! Seems I didn't quite understand how to copy a link in
Infocenter!

http://publib.boulder.ibm.com/infocenter/zvm/v5r4/topic/com.ibm.zos.r9.cbcpx
01/cbcpg180781.htm#wq1935

On 3/05/2012 1:09 AM, Charles Mills wrote:
 Full samples of deblocking BPAM directory blocks with code? Which program?

 I don't see any examples in the P/G you linked to either. What am I
missing?

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-05-01 Thread Paul Gilmartin
On Mon, 30 Apr 2012 13:20:48 -0700, Charles Mills wrote:

At least too many OPEN's is better than too many DYNALLOC's *and* too many
OPEN's.

Ummm.  No.  A few years ago, I had an APAR created because
the z/OS UNIX (USS) command e.g.:

$ cp  -P'SPACE=(5000,5000)'  homelog  //temp.test.space3

cp: FSUM6260 write error on file //temp.test.space3: EDC5092I An I/O 
abend was trapped.
$ ls -l homelog
-rw-r--r--   1 user   group   346153 Jan 12 14:05 homelog

was failing with a Sx37, regardless of how large an extent I requested.
IBM's explanation:

o If the programmer specified SPACE, the C/LE RTL assumed a RLSE
  subparameter.

  (This seems precisely backward to me.  If the RTL supplies a generous
  default, RLSE may be appropriate.  If the programmer specified SPACE
  explicitly, give him what he asks for.)

o The command internally caused the data set to be opened and closed
  _four_ times (!?!?!?!).  After the first close, most of the space was
  released.  The attempt to write the actual data was bound to fail
  writing to a minimal extent.

IBM's reactions were:

o Specify a secondary extent.

o FIN.

o For compatibility, we'll retain the current behavior, but provide
  the programmer a NORLSE option.

The problem persists at z/OS 1.12:

D37-04,IFG0554P,user,STEP1,SYS00017,41CA,TSO026,user.TEMP.TEST.SPACE3   

There seems to be no NORLSE option.  If I supply a secondary
extent, I get an 8 block (1 track?) primary extent and a 4008 block
second extent.

SIGH/  I can't respect this.  Does any IBM representative dare to
comment on it?

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-05-01 Thread Paul Gilmartin
On Mon, 30 Apr 2012 23:43:24 +0200, Bernd Oppolzer wrote:

Don't know what it's worth, but I'm quite sure that you can read a directory
of a PDS simply by issuing fopen on it as a binary file - like this

directory = fopen (dd:pdsfile, rb);

that is, if you don't specify member names in parantheses, you get the
directory of the PDS.
  
Rexx, for example, doesn't work quite that way.  The open fails unless
the programmer specifies DSORG(PS)  at allocation.

And, yes, if you specify dd:dsname on fopen, there will be no DYNALLOC
etc. and no SYSx ddnames, because there is already a ddname.
  
FTP, for another example, doesn't work quite that way.  Overriding
attributes at allocation will sometimes be ignored and attributes
from the DSCB used regardless.

TSO TRANSMIT, for YA example doesn't work that way.  If I allocate
DATA.SET.NAME(MEMBER), which is a sequential allocation, and pass
the ddname as INDD to TRANSMIT, it is transmitted as an IEBCOPY
unloaded PDS member.

I don't know for any of these cases whether the utility uses the
argument DDNAME after tweaking the JFCB, or performs a DYNALLOC.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-05-01 Thread John Gilmore
The point here is not what some particular routine oor utility may do
or permit.  It is what can be done ab initio by an programmer who
wants to do it using the HLASM or some particular SLPL .

z/OS MVS does permit one to open a PDS as a PS data set in a routine
written in assembly language or PL/I, and what one then gets with
successive reads are its successive directory blocks.

I have done this many times without incident, but I do not of course
recommend it to novices.

I have not myself done it in C; but Bernd Oppolzer is a careful,
highly reliable reporter of his experience; and I am thus sure that it
can be done in C too.

John Gilmore, Ashland, MA 01721 - USA

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-05-01 Thread Bernd Oppolzer

Thank you!

Here is an excerpt of a C program which reads a directory of a PDS
and inserts the member names into an AVL tree (the insert is not shown,
it is done by a function call - see below).

Kind regards

Bernd



static int lese_memberliste (char *parm_infile,
 baumMEMknoten **pres)

//
/*   Funktion zum Lesen einer Memberliste   */
/*   einer PO-Datei; die Membernamen werden */
/*   in einen AVL-Baum eingetragen  */
//

{
   FILE *direct;
   char buf [256];
   int x;
   char *cp;
   int laenge;
   unsigned long ttrc;
   int ttr;
   int anz_bytes;
   int eof;
   int rc = 0;

   char mem_high [8];

   baumMEMknoten *proot = NULL;
   baumMEMknoten *pneu;
   int hchanged;
   membname m;

   eof = 0;

   memset (mem_high, 0xff, 8);

   //
   /*   raus, wenn Directory nicht aufgeht */
   //

   direct = fopen (parm_infile, rb);
   if (direct == NULL)
  RETURN_VALUE 8;

   for (;;)
   {
  //
  /*   naechsten Directory-Block einlesen */
  //

  memset (buf, 0x00, 256);
  x = fread (buf, 1, 256, direct);
  if (x == 0)
 break;

#ifdef TEST

  printf ([cp2970] \n);
  printf ([cp2970] Rueckgabe von fread = %d\n, x);
  printf ([cp2970] \n);

  dump (buf, buf + x - 1, stdout);

#endif

  cp = buf + 2;
  laenge = *((short *) buf) - 2;

  while (laenge  0)
  {
 //
 /*   naehere Info hierzu in den IBM-Brosch. */
 /*   zum Aufbau der PO-Directories. */
 //

 if (memcmp (cp, mem_high, 8) == 0)
 {
eof = 1;
break;
 }

 //
 /*   Laenge des Eintrags in Halbworten steht*/
 /*   in den Bits 3 bis 7 des TTRC-Wortes*/
 //

 ttrc = *((unsigned long *) (cp + 8));
 ttr = ttrc  8;
 anz_bytes = (ttrc  0x1f) * 2;

#ifdef TEST

 printf ([cp2970] Member %-8.8s  TTR %06X  Laenge/Bytes %d\n,
 cp, ttr, anz_bytes);

#endif

 if (memcmp (cp, ED, 2) == 0)
 {
memcpy (m.name, cp, 8);

hchanged = 0;
pneu = baumMEMsuche (m, proot, hchanged, 1);
pneu - obj = atoi (cp + 2);
 }

 cp += (anz_bytes + 12);
 laenge -= (anz_bytes + 12);
  }

  if (eof)
 break;
   }

   fclose (direct);

   *pres = proot;

   RETURN_VALUE rc;
}




Am 01.05.2012 23:52, schrieb John Gilmore:

The point here is not what some particular routine oor utility may do
or permit.  It is what can be done ab initio by an programmer who
wants to do it using the HLASM or some particular SLPL .

z/OS MVS does permit one to open a PDS as a PS data set in a routine
written in assembly language or PL/I, and what one then gets with
successive reads are its successive directory blocks.

I have done this many times without incident, but I do not of course
recommend it to novices.

I have not myself done it in C; but Bernd Oppolzer is a careful,
highly reliable reporter of his experience; and I am thus sure that it
can be done in C too.

John Gilmore, Ashland, MA 01721 - USA

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN



--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-05-01 Thread Charles Mills
Thanks!

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf
Of Bernd Oppolzer
Sent: Tuesday, May 01, 2012 6:09 PM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

Thank you!

Here is an excerpt of a C program which reads a directory of a PDS and
inserts the member names into an AVL tree (the insert is not shown, it is
done by a function call - see below).

Kind regards

Bernd



static int lese_memberliste (char *parm_infile,
  baumMEMknoten **pres)

//
/*   Funktion zum Lesen einer Memberliste   */
/*   einer PO-Datei; die Membernamen werden */
/*   in einen AVL-Baum eingetragen  */
//

{
FILE *direct;
char buf [256];
int x;
char *cp;
int laenge;
unsigned long ttrc;
int ttr;
int anz_bytes;
int eof;
int rc = 0;

char mem_high [8];

baumMEMknoten *proot = NULL;
baumMEMknoten *pneu;
int hchanged;
membname m;

eof = 0;

memset (mem_high, 0xff, 8);

//
/*   raus, wenn Directory nicht aufgeht */
//

direct = fopen (parm_infile, rb);
if (direct == NULL)
   RETURN_VALUE 8;

for (;;)
{
   //
   /*   naechsten Directory-Block einlesen */
   //

   memset (buf, 0x00, 256);
   x = fread (buf, 1, 256, direct);
   if (x == 0)
  break;

#ifdef TEST

   printf ([cp2970] \n);
   printf ([cp2970] Rueckgabe von fread = %d\n, x);
   printf ([cp2970] \n);

   dump (buf, buf + x - 1, stdout);

#endif

   cp = buf + 2;
   laenge = *((short *) buf) - 2;

   while (laenge  0)
   {
  //
  /*   naehere Info hierzu in den IBM-Brosch. */
  /*   zum Aufbau der PO-Directories. */
  //

  if (memcmp (cp, mem_high, 8) == 0)
  {
 eof = 1;
 break;
  }

  //
  /*   Laenge des Eintrags in Halbworten steht*/
  /*   in den Bits 3 bis 7 des TTRC-Wortes*/
  //

  ttrc = *((unsigned long *) (cp + 8));
  ttr = ttrc  8;
  anz_bytes = (ttrc  0x1f) * 2;

#ifdef TEST

  printf ([cp2970] Member %-8.8s  TTR %06X  Laenge/Bytes %d\n,
  cp, ttr, anz_bytes);

#endif

  if (memcmp (cp, ED, 2) == 0)
  {
 memcpy (m.name, cp, 8);

 hchanged = 0;
 pneu = baumMEMsuche (m, proot, hchanged, 1);
 pneu - obj = atoi (cp + 2);
  }

  cp += (anz_bytes + 12);
  laenge -= (anz_bytes + 12);
   }

   if (eof)
  break;
}

fclose (direct);

*pres = proot;

RETURN_VALUE rc;
}




Am 01.05.2012 23:52, schrieb John Gilmore:
 The point here is not what some particular routine oor utility may do 
 or permit.  It is what can be done ab initio by an programmer who 
 wants to do it using the HLASM or some particular SLPL .

 z/OS MVS does permit one to open a PDS as a PS data set in a routine 
 written in assembly language or PL/I, and what one then gets with 
 successive reads are its successive directory blocks.

 I have done this many times without incident, but I do not of course 
 recommend it to novices.

 I have not myself done it in C; but Bernd Oppolzer is a careful, 
 highly reliable reporter of his experience; and I am thus sure that it 
 can be done in C too.

 John Gilmore, Ashland, MA 01721 - USA

 --
 For IBM-MAIN subscribe / signoff / archive access instructions, send 
 email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions, send email
to lists...@bama.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-05-01 Thread David Crayford
The book also has examples and you will find full samples in the 
SCBCSAMP data set.


http://publib.boulder.ibm.com/infocenter/zvm/v5r4/index.jsp?topic=/com.ibm.zos.r9.cbcpx01/cbcpg18096.htm

On 2/05/2012 9:58 AM, Charles Mills wrote:

Thanks!

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf
Of Bernd Oppolzer
Sent: Tuesday, May 01, 2012 6:09 PM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

Thank you!

Here is an excerpt of a C program which reads a directory of a PDS and
inserts the member names into an AVL tree (the insert is not shown, it is
done by a function call - see below).

Kind regards

Bernd



static int lese_memberliste (char *parm_infile,
   baumMEMknoten **pres)

//
/*   Funktion zum Lesen einer Memberliste   */
/*   einer PO-Datei; die Membernamen werden */
/*   in einen AVL-Baum eingetragen  */
//

{
 FILE *direct;
 char buf [256];
 int x;
 char *cp;
 int laenge;
 unsigned long ttrc;
 int ttr;
 int anz_bytes;
 int eof;
 int rc = 0;

 char mem_high [8];

 baumMEMknoten *proot = NULL;
 baumMEMknoten *pneu;
 int hchanged;
 membname m;

 eof = 0;

 memset (mem_high, 0xff, 8);

 //
 /*   raus, wenn Directory nicht aufgeht */
 //

 direct = fopen (parm_infile, rb);
 if (direct == NULL)
RETURN_VALUE 8;

 for (;;)
 {
//
/*   naechsten Directory-Block einlesen */
//

memset (buf, 0x00, 256);
x = fread (buf, 1, 256, direct);
if (x == 0)
   break;

#ifdef TEST

printf ([cp2970] \n);
printf ([cp2970] Rueckgabe von fread = %d\n, x);
printf ([cp2970] \n);

dump (buf, buf + x - 1, stdout);

#endif

cp = buf + 2;
laenge = *((short *) buf) - 2;

while (laenge  0)
{
   //
   /*   naehere Info hierzu in den IBM-Brosch. */
   /*   zum Aufbau der PO-Directories. */
   //

   if (memcmp (cp, mem_high, 8) == 0)
   {
  eof = 1;
  break;
   }

   //
   /*   Laenge des Eintrags in Halbworten steht*/
   /*   in den Bits 3 bis 7 des TTRC-Wortes*/
   //

   ttrc = *((unsigned long *) (cp + 8));
   ttr = ttrc  8;
   anz_bytes = (ttrc  0x1f) * 2;

#ifdef TEST

   printf ([cp2970] Member %-8.8s  TTR %06X  Laenge/Bytes %d\n,
   cp, ttr, anz_bytes);

#endif

   if (memcmp (cp, ED, 2) == 0)
   {
  memcpy (m.name, cp, 8);

  hchanged = 0;
  pneu = baumMEMsuche (m,proot,hchanged, 1);
  pneu -  obj = atoi (cp + 2);
   }

   cp += (anz_bytes + 12);
   laenge -= (anz_bytes + 12);
}

if (eof)
   break;
 }

 fclose (direct);

 *pres = proot;

 RETURN_VALUE rc;
}




Am 01.05.2012 23:52, schrieb John Gilmore:

The point here is not what some particular routine oor utility may do
or permit.  It is what can be done ab initio by an programmer who
wants to do it using the HLASM or some particular SLPL .

z/OS MVS does permit one to open a PDS as a PS data set in a routine
written in assembly language or PL/I, and what one then gets with
successive reads are its successive directory blocks.

I have done this many times without incident, but I do not of course
recommend it to novices.

I have not myself done it in C; but Bernd Oppolzer is a careful,
highly reliable reporter of his experience; and I am thus sure that it
can be done in C too.

John Gilmore, Ashland, MA 01721 - USA

--
For IBM-MAIN subscribe / signoff / archive access instructions, send
email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions, send email
to lists...@bama.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN

Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-04-30 Thread Charles Mills
Does anyone *know* whether a C/C++ Language Environment fopen() of a
filename of the form DD:ddname(member) use an OPEN of ddname followed by a
BLDL or FIND for member (the way any reasonable programmer would) or does it
do a whole new DYNALLOC for dsname(member)? (Seems like a dumb question, but
FTP does it that way, so stranger things have happened.)

My *interpretation* of the allocation messages - I don't see allocate and
de-allocate messages for a SYSn that appears to be for member - leads me
to believe that C/C++ LE does it right. But I could be reading it wrong.
Does anyone *know*?

Thanks,
Charles 

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-04-30 Thread Kirk Wolf
Charles,

I'm nearly certain that it doesn't do a SVC99 when you are using fopen with
a DDNAME

But it does seem to do a OPEN/BLDL/POINTSTOW/CLOSEfor each fopen()
/ fclose()  using //DD:MYDD(MEM)

IMO, there are a couple of important missing things:

1) There isn't a way to update (or get) the PDS directory user data when
processing the member with fopen()/fclose().

2) You would really like to be able to do this:

fopen(//DD:MYDD(MEM1), ...)
freopen(//DD:MYDD(MEM2), )

so that the freopen() caused a STOW (if opened update) and a BLDL/POINT,
and avoided the cost of a complete OPEN/CLOSE path.I don't think that
it does that.

So, for my money, better BPAM support would be nice.

Kirk Wolf
Dovetailed Technologies
http://dovetail.com

On Mon, Apr 30, 2012 at 11:45 AM, Charles Mills charl...@mcn.org wrote:

 Does anyone *know* whether a C/C++ Language Environment fopen() of a
 filename of the form DD:ddname(member) use an OPEN of ddname followed by a
 BLDL or FIND for member (the way any reasonable programmer would) or does
 it
 do a whole new DYNALLOC for dsname(member)? (Seems like a dumb question,
 but
 FTP does it that way, so stranger things have happened.)

 My *interpretation* of the allocation messages - I don't see allocate and
 de-allocate messages for a SYSn that appears to be for member - leads
 me
 to believe that C/C++ LE does it right. But I could be reading it wrong.
 Does anyone *know*?

 Thanks,
 Charles

 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-04-30 Thread Charles Mills
Thanks!

At least too many OPEN's is better than too many DYNALLOC's *and* too many
OPEN's.

 There isn't a way to update (or get) the PDS directory user data

Not a huge deal to write your own BPAM library, but I agree. When I first
came to z/OS C/C++ about two years ago I was surprised that there were not
more z/OS-specific library routines (or z/OS-specific enhancements to the
inherited-from-UNIX library routines).

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf
Of Kirk Wolf
Sent: Monday, April 30, 2012 11:11 AM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

Charles,

I'm nearly certain that it doesn't do a SVC99 when you are using fopen with
a DDNAME

But it does seem to do a OPEN/BLDL/POINTSTOW/CLOSEfor each fopen()
/ fclose()  using //DD:MYDD(MEM)

IMO, there are a couple of important missing things:

1) There isn't a way to update (or get) the PDS directory user data when
processing the member with fopen()/fclose().

2) You would really like to be able to do this:

fopen(//DD:MYDD(MEM1), ...)
freopen(//DD:MYDD(MEM2), )

so that the freopen() caused a STOW (if opened update) and a BLDL/POINT,
and avoided the cost of a complete OPEN/CLOSE path.I don't think that
it does that.

So, for my money, better BPAM support would be nice.

Kirk Wolf
Dovetailed Technologies
http://dovetail.com

On Mon, Apr 30, 2012 at 11:45 AM, Charles Mills charl...@mcn.org wrote:

 Does anyone *know* whether a C/C++ Language Environment fopen() of a 
 filename of the form DD:ddname(member) use an OPEN of ddname followed 
 by a BLDL or FIND for member (the way any reasonable programmer would) 
 or does it do a whole new DYNALLOC for dsname(member)? (Seems like a 
 dumb question, but FTP does it that way, so stranger things have 
 happened.)

 My *interpretation* of the allocation messages - I don't see allocate 
 and de-allocate messages for a SYSn that appears to be for member 
 - leads me to believe that C/C++ LE does it right. But I could be 
 reading it wrong.
 Does anyone *know*?

 Thanks,
 Charles

 --
 For IBM-MAIN subscribe / signoff / archive access instructions, send 
 email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions, send email
to lists...@bama.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

2012-04-30 Thread Bernd Oppolzer

Don't know what it's worth, but I'm quite sure that you can read a directory
of a PDS simply by issuing fopen on it as a binary file - like this

directory = fopen (dd:pdsfile, rb);

that is, if you don't specify member names in parantheses, you get the 
directory of the PDS.


And, yes, if you specify dd:dsname on fopen, there will be no DYNALLOC 
etc. and no
SYSx ddnames, because there is already a ddname. I understand that 
those synthetic
ddnames like SYS1 etc. are only needed, if you specify dsnames on 
fopen. Or,
another case, if you do output to stdout by printf, for example, but 
SYSPRINT is already

blocked (used, opened) by PL/1 (for example).

Kind regards

Bernd



Am 30.04.2012 22:20, schrieb Charles Mills:

Thanks!

At least too many OPEN's is better than too many DYNALLOC's *and* too many
OPEN's.


There isn't a way to update (or get) the PDS directory user data

Not a huge deal to write your own BPAM library, but I agree. When I first
came to z/OS C/C++ about two years ago I was surprised that there were not
more z/OS-specific library routines (or z/OS-specific enhancements to the
inherited-from-UNIX library routines).

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf
Of Kirk Wolf
Sent: Monday, April 30, 2012 11:11 AM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Does C/LE open of DD:ddname(member) use SVC 99 or FIND?

Charles,

I'm nearly certain that it doesn't do a SVC99 when you are using fopen with
a DDNAME

But it does seem to do a OPEN/BLDL/POINTSTOW/CLOSEfor each fopen()
/ fclose()  using //DD:MYDD(MEM)

IMO, there are a couple of important missing things:

1) There isn't a way to update (or get) the PDS directory user data when
processing the member with fopen()/fclose().

2) You would really like to be able to do this:

fopen(//DD:MYDD(MEM1), ...)
freopen(//DD:MYDD(MEM2), )

so that the freopen() caused a STOW (if opened update) and a BLDL/POINT,
and avoided the cost of a complete OPEN/CLOSE path.I don't think that
it does that.

So, for my money, better BPAM support would be nice.

Kirk Wolf
Dovetailed Technologies
http://dovetail.com

On Mon, Apr 30, 2012 at 11:45 AM, Charles Millscharl...@mcn.org  wrote:


Does anyone *know* whether a C/C++ Language Environment fopen() of a
filename of the form DD:ddname(member) use an OPEN of ddname followed
by a BLDL or FIND for member (the way any reasonable programmer would)
or does it do a whole new DYNALLOC for dsname(member)? (Seems like a
dumb question, but FTP does it that way, so stranger things have
happened.)

My *interpretation* of the allocation messages - I don't see allocate
and de-allocate messages for a SYSn that appears to be for member
- leads me to believe that C/C++ LE does it right. But I could be
reading it wrong.
Does anyone *know*?

Thanks,
Charles




--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN