Discussion:
empty file;
(too old to reply)
Hamilton, Robert L
2007-10-09 15:14:16 UTC
Permalink
In batch rexx under TSO what's the easiest way to determine if a file is
'empty' -- i.e. has no records.

I cannot get LISTDSI to work and doing an EXECIO to read and check
records seems a waste.

???

bobh



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
McKown, John
2007-10-09 15:31:09 UTC
Permalink
> -----Original Message-----
> From: TSO REXX Discussion List
> [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Hamilton, Robert L
> Sent: Tuesday, October 09, 2007 10:14 AM
> To: TSO-***@VM.MARIST.EDU
> Subject: [TSO-REXX] empty file;
>
>
> In batch rexx under TSO what's the easiest way to determine
> if a file is
> 'empty' -- i.e. has no records.
>
> I cannot get LISTDSI to work and doing an EXECIO to read and check
> records seems a waste.
>
> ???
>
> bobh

The only way to be really, really sure is to try to read the dataset.
There is nothing in the VTOC or elsewhere to indicate "empty" reliably.
Now, you can look at the DS1LSTAR in the VTOC and __HOPE__ that it is
accurate.

--
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 TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Binyamin Dissen
2007-10-09 16:18:18 UTC
Permalink
On Tue, 9 Oct 2007 10:24:49 -0500 "McKown, John"
<***@HEALTHMARKETS.COM> wrote:

:>The only way to be really, really sure is to try to read the dataset.
:>There is nothing in the VTOC or elsewhere to indicate "empty" reliably.
:>Now, you can look at the DS1LSTAR in the VTOC and __HOPE__ that it is
:>accurate.

Even if it can be read, it does not prove that the records are not residual
data.

--
Binyamin Dissen <***@dissensoftware.com>
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 TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Michael Bradley
2007-10-09 15:31:49 UTC
Permalink
Robert said:
In batch rexx under TSO what's the easiest way to determine if a file is
'empty' -- i.e. has no records.
I cannot get LISTDSI to work and doing an EXECIO to read and check
records seems a waste.

I agree; it's a waste. There's no I/O like No I/O!

I recently had this requirement, and all I could come up with was:
'EXECIO 1 DISKR' aDD '(FINIS STEM xx.'

if xx.0 was > 0 I would then FTP the file.

I'd love to know of a better way; maybe reading the DSCB, if it can be done
without authorization.

Michael

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Mickey Bee
2007-10-09 16:19:46 UTC
Permalink
And what would make this MORE efficient than:

"EXECIO 1 DISKR myfile (stem x. fini"

i/o is i/o

My question here would be, why is LISTDSI not working.

Mickey

-------------- Original message ----------------------
From: Joco Lums Matos Carvalho (DSI) <***@CAIXASEGUROS.PT>
> FileAid is not necessary !
> You can use this JCL STEP example below :
>
> //TESTE001 EXEC PGM=IDCAMS
> //SYSPRINT DD SYSOUT=*
> //SYSOUT DD SYSOUT=*
> //AMSDUMP DD SYSOUT=*
> //DSFI DD DSN=PMTRFGR.FFS100.PWFSFMV1,DISP=SHR,
> // BUFNO=10
> //DSFO DD DUMMY,DCB=LRECL=266,RECFM=FB,DSORG=PS
> //SYSIN DD *
> REPRO INFILE(ENTRADA) OUTFILE(SAIDA) COUNT(1)
> /*
> //*
>
> If RC = 0, isn't empty !
>
> Atenciosamente,
> Joco Carvalho
> * - mailto:***@caixaseguros.pt
> "Em momentos de crise, ss a imaginagco i mais importante que o conhecimento"
> (Albert Einstein)
> P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Ha cada vez
> menos arvores
> -----Original Message-----
> From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
> Dunkel, Martin
> Sent: terga-feira, 9 de Outubro de 2007 16:35
> To: TSO-***@VM.MARIST.EDU
> Subject: Re: [TSO-REXX] empty file;
>
> Robert,
>
> What I have seen done (and I am pretty sure we have this in production)
> is to run a FileAid (which you can code in Rexx) to copy 1 record of a
> file. If you get a return code 8, then the file was empty. And, if you
> get a return code 0, then there was something to copy.
>
> If you need an example, I can try to search around.
>
> Thanks! MPD
>
> Martin Dunkel
> National City Corporation
> Turnover Support / ChangeMan ZMF
> (w) 216-257-5354
> (p) ***@archwireless.net
>
> -----Original Message-----
> From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
> Of Hamilton, Robert L
> Sent: Tuesday, October 09, 2007 11:14 AM
> To: TSO-***@VM.MARIST.EDU
> Subject: [TSO-REXX] empty file;
>
> In batch rexx under TSO what's the easiest way to determine if a file is
> 'empty' -- i.e. has no records.
>
> I cannot get LISTDSI to work and doing an EXECIO to read and check
> records seems a waste.
>
> ???
>
> bobh
>
>
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
>
>
> --------------------------------------------------------------------------------
> -----------
> ***National City made the following annotations
> --------------------------------------------------------------------------------
> -----------
> This communication is a confidential and proprietary business communication.
> It is intended solely for the use of the designated recipient(s). If this
> communication is received in error, please contact the sender and delete
> this communication.
> ================================================================================
> ===========
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Dunkel, Martin
2007-10-09 16:33:18 UTC
Permalink
João,

Thank you for that. Now that I think back, it is IDCAMS, not Fileaid that we use for this. An IDCAMS can very easily be incorporated in a Rexx program by simply allocating the DD's, queuing the SYSIN and calling IDCAMS. You can then check the rc coming back.

And, yes, this will only tell you the file is not empty. This will tell you nothing about the validity of the data.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of João Luís Matos Carvalho (DSI)
Sent: Tuesday, October 09, 2007 12:05 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

FileAid is not necessary !
You can use this JCL STEP example below :

//TESTE001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//AMSDUMP DD SYSOUT=*
//DSFI DD DSN=PMTRFGR.FFS100.PWFSFMV1,DISP=SHR,
// BUFNO=10
//DSFO DD DUMMY,DCB=LRECL=266,RECFM=FB,DSORG=PS
//SYSIN DD *
REPRO INFILE(ENTRADA) OUTFILE(SAIDA) COUNT(1)
/*
//*

If RC = 0, isn't empty !

Atenciosamente,
João Carvalho
* - mailto:***@caixaseguros.pt
"Em momentos de crise, só a imaginação é mais importante que o conhecimento"
(Albert Einstein)
P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada vez menos árvores
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dunkel, Martin
Sent: terça-feira, 9 de Outubro de 2007 16:35
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

Robert,

What I have seen done (and I am pretty sure we have this in production)
is to run a FileAid (which you can code in Rexx) to copy 1 record of a
file. If you get a return code 8, then the file was empty. And, if you
get a return code 0, then there was something to copy.

If you need an example, I can try to search around.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Hamilton, Robert L
Sent: Tuesday, October 09, 2007 11:14 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] empty file;

In batch rexx under TSO what's the easiest way to determine if a file is
'empty' -- i.e. has no records.

I cannot get LISTDSI to work and doing an EXECIO to read and check
records seems a waste.

???

bobh



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


-------------------------------------------------------------------------------------------
***National City made the following annotations
-------------------------------------------------------------------------------------------
This communication is a confidential and proprietary business communication.
It is intended solely for the use of the designated recipient(s). If this
communication is received in error, please contact the sender and delete
this communication.
===========================================================================================

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Harrington, Mark
2007-10-09 17:38:49 UTC
Permalink
If you have ICEMAN it will tell you if the file is empty

M.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dunkel, Martin
Sent: Tuesday, October 09, 2007 9:33 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

João,

Thank you for that. Now that I think back, it is IDCAMS, not Fileaid that we use for this. An IDCAMS can very easily be incorporated in a Rexx program by simply allocating the DD's, queuing the SYSIN and calling IDCAMS. You can then check the rc coming back.

And, yes, this will only tell you the file is not empty. This will tell you nothing about the validity of the data.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of João Luís Matos Carvalho (DSI)
Sent: Tuesday, October 09, 2007 12:05 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

FileAid is not necessary !
You can use this JCL STEP example below :

//TESTE001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//AMSDUMP DD SYSOUT=*
//DSFI DD DSN=PMTRFGR.FFS100.PWFSFMV1,DISP=SHR,
// BUFNO=10
//DSFO DD DUMMY,DCB=LRECL=266,RECFM=FB,DSORG=PS
//SYSIN DD *
REPRO INFILE(ENTRADA) OUTFILE(SAIDA) COUNT(1)
/*
//*

If RC = 0, isn't empty !

Atenciosamente,
João Carvalho
* - mailto:***@caixaseguros.pt
"Em momentos de crise, só a imaginação é mais importante que o conhecimento"
(Albert Einstein)
P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada vez menos árvores
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dunkel, Martin
Sent: terça-feira, 9 de Outubro de 2007 16:35
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

Robert,

What I have seen done (and I am pretty sure we have this in production)
is to run a FileAid (which you can code in Rexx) to copy 1 record of a
file. If you get a return code 8, then the file was empty. And, if you
get a return code 0, then there was something to copy.

If you need an example, I can try to search around.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Hamilton, Robert L
Sent: Tuesday, October 09, 2007 11:14 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] empty file;

In batch rexx under TSO what's the easiest way to determine if a file is
'empty' -- i.e. has no records.

I cannot get LISTDSI to work and doing an EXECIO to read and check
records seems a waste.

???

bobh



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


-------------------------------------------------------------------------------------------
***National City made the following annotations
-------------------------------------------------------------------------------------------
This communication is a confidential and proprietary business communication.
It is intended solely for the use of the designated recipient(s). If this
communication is received in error, please contact the sender and delete
this communication.
===========================================================================================

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX



----------------------------------------------------------
IMPORTANT WARNING: This email (and any attachments) is only intended for the use of the person or entity to which it is addressed, and may contain information that is privileged and confidential. You, the recipient, are obligated to maintain it in a safe, secure and confidential manner. Unauthorized redisclosure or failure to maintain confidentiality may subject you to federal and state penalties. If you are not the recipient, please immediately notify us by return email, and delete this message from your computer.
----------------------------------------------------------

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Michael Bradley
2007-10-09 20:24:22 UTC
Permalink
Mark said:
If you have ICEMAN it will tell you if the file is empty

Do you have any specifics?

Michael

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Jeff Byrum
2007-10-09 19:33:50 UTC
Permalink
Just FYI, REPRO is also a TSO command (I think most, if not all, IDCAMS commands are as well) so you can just invoke it directly from a REXX exec running under TSO or ISPF (with ADDRESS TSO) without having to explicitly allocate the datasets or create a SYSIN with queuing...

Jeff

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dunkel, Martin
Sent: Tuesday, October 09, 2007 12:33 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

João,

Thank you for that. Now that I think back, it is IDCAMS, not Fileaid that we use for this. An IDCAMS can very easily be incorporated in a Rexx program by simply allocating the DD's, queuing the SYSIN and calling IDCAMS. You can then check the rc coming back.

And, yes, this will only tell you the file is not empty. This will tell you nothing about the validity of the data.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of João Luís Matos Carvalho (DSI)
Sent: Tuesday, October 09, 2007 12:05 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

FileAid is not necessary !
You can use this JCL STEP example below :

//TESTE001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//AMSDUMP DD SYSOUT=*
//DSFI DD DSN=PMTRFGR.FFS100.PWFSFMV1,DISP=SHR,
// BUFNO=10
//DSFO DD DUMMY,DCB=LRECL=266,RECFM=FB,DSORG=PS
//SYSIN DD *
REPRO INFILE(ENTRADA) OUTFILE(SAIDA) COUNT(1)
/*
//*

If RC = 0, isn't empty !

Atenciosamente,
João Carvalho
* - mailto:***@caixaseguros.pt
"Em momentos de crise, só a imaginação é mais importante que o conhecimento"
(Albert Einstein)
P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada vez menos árvores
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dunkel, Martin
Sent: terça-feira, 9 de Outubro de 2007 16:35
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

Robert,

What I have seen done (and I am pretty sure we have this in production)
is to run a FileAid (which you can code in Rexx) to copy 1 record of a
file. If you get a return code 8, then the file was empty. And, if you
get a return code 0, then there was something to copy.

If you need an example, I can try to search around.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Hamilton, Robert L
Sent: Tuesday, October 09, 2007 11:14 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] empty file;

In batch rexx under TSO what's the easiest way to determine if a file is
'empty' -- i.e. has no records.

I cannot get LISTDSI to work and doing an EXECIO to read and check
records seems a waste.

???

bobh



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


-------------------------------------------------------------------------------------------
***National City made the following annotations
-------------------------------------------------------------------------------------------
This communication is a confidential and proprietary business communication.
It is intended solely for the use of the designated recipient(s). If this
communication is received in error, please contact the sender and delete
this communication.
===========================================================================================

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Hamilton, Robert L
2007-10-09 23:12:06 UTC
Permalink
And the winner is

"repro INFILE(nofiller) Outfile(sysprint)"
SAY RETURN CODE IS RC

With no recs you get a rc = 12 otoh you get rc = 0

bobh

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Jeff Byrum
Sent: Tuesday, October 09, 2007 2:33 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

Just FYI, REPRO is also a TSO command (I think most, if not all, IDCAMS commands are as well) so you can just invoke it directly from a REXX exec running under TSO or ISPF (with ADDRESS TSO) without having to explicitly allocate the datasets or create a SYSIN with queuing...

Jeff

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dunkel, Martin
Sent: Tuesday, October 09, 2007 12:33 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

João,

Thank you for that. Now that I think back, it is IDCAMS, not Fileaid that we use for this. An IDCAMS can very easily be incorporated in a Rexx program by simply allocating the DD's, queuing the SYSIN and calling IDCAMS. You can then check the rc coming back.

And, yes, this will only tell you the file is not empty. This will tell you nothing about the validity of the data.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of João Luís Matos Carvalho (DSI)
Sent: Tuesday, October 09, 2007 12:05 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

FileAid is not necessary !
You can use this JCL STEP example below :

//TESTE001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//AMSDUMP DD SYSOUT=*
//DSFI DD DSN=PMTRFGR.FFS100.PWFSFMV1,DISP=SHR,
// BUFNO=10
//DSFO DD DUMMY,DCB=LRECL=266,RECFM=FB,DSORG=PS
//SYSIN DD *
REPRO INFILE(ENTRADA) OUTFILE(SAIDA) COUNT(1)
/*
//*

If RC = 0, isn't empty !

Atenciosamente,
João Carvalho
* - mailto:***@caixaseguros.pt
"Em momentos de crise, só a imaginação é mais importante que o conhecimento"
(Albert Einstein)
P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada vez menos árvores
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dunkel, Martin
Sent: terça-feira, 9 de Outubro de 2007 16:35
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

Robert,

What I have seen done (and I am pretty sure we have this in production)
is to run a FileAid (which you can code in Rexx) to copy 1 record of a
file. If you get a return code 8, then the file was empty. And, if you
get a return code 0, then there was something to copy.

If you need an example, I can try to search around.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Hamilton, Robert L
Sent: Tuesday, October 09, 2007 11:14 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] empty file;

In batch rexx under TSO what's the easiest way to determine if a file is
'empty' -- i.e. has no records.

I cannot get LISTDSI to work and doing an EXECIO to read and check
records seems a waste.

???

bobh



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


-------------------------------------------------------------------------------------------
***National City made the following annotations
-------------------------------------------------------------------------------------------
This communication is a confidential and proprietary business communication.
It is intended solely for the use of the designated recipient(s). If this
communication is received in error, please contact the sender and delete
this communication.
===========================================================================================

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Mickey
2007-10-10 00:52:08 UTC
Permalink
Not faster than EXECIO 1 DISKR, and checking for either an RC of 2 or a stem
with zero entries.

Mickey

----- Original Message -----
From: "Hamilton, Robert L" <***@UTDALLAS.EDU>
To: <TSO-***@VM.MARIST.EDU>
Sent: Tuesday, October 09, 2007 5:43 PM
Subject: Re: [TSO-REXX] empty file;


And the winner is

"repro INFILE(nofiller) Outfile(sysprint)"
SAY RETURN CODE IS RC

With no recs you get a rc = 12 otoh you get rc = 0

bobh

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Jeff Byrum
Sent: Tuesday, October 09, 2007 2:33 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

Just FYI, REPRO is also a TSO command (I think most, if not all, IDCAMS
commands are as well) so you can just invoke it directly from a REXX exec
running under TSO or ISPF (with ADDRESS TSO) without having to explicitly
allocate the datasets or create a SYSIN with queuing...

Jeff

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Dunkel, Martin
Sent: Tuesday, October 09, 2007 12:33 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

João,

Thank you for that. Now that I think back, it is IDCAMS, not Fileaid that
we use for this. An IDCAMS can very easily be incorporated in a Rexx
program by simply allocating the DD's, queuing the SYSIN and calling IDCAMS.
You can then check the rc coming back.

And, yes, this will only tell you the file is not empty. This will tell you
nothing about the validity of the data.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
João Luís Matos Carvalho (DSI)
Sent: Tuesday, October 09, 2007 12:05 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

FileAid is not necessary !
You can use this JCL STEP example below :

//TESTE001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//AMSDUMP DD SYSOUT=*
//DSFI DD DSN=PMTRFGR.FFS100.PWFSFMV1,DISP=SHR,
// BUFNO=10
//DSFO DD DUMMY,DCB=LRECL=266,RECFM=FB,DSORG=PS
//SYSIN DD *
REPRO INFILE(ENTRADA) OUTFILE(SAIDA) COUNT(1)
/*
//*

If RC = 0, isn't empty !

Atenciosamente,
João Carvalho
* - mailto:***@caixaseguros.pt
"Em momentos de crise, só a imaginação é mais importante que o conhecimento"
(Albert Einstein)
P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada
vez menos árvores
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Dunkel, Martin
Sent: terça-feira, 9 de Outubro de 2007 16:35
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

Robert,

What I have seen done (and I am pretty sure we have this in production)
is to run a FileAid (which you can code in Rexx) to copy 1 record of a
file. If you get a return code 8, then the file was empty. And, if you
get a return code 0, then there was something to copy.

If you need an example, I can try to search around.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Hamilton, Robert L
Sent: Tuesday, October 09, 2007 11:14 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] empty file;

In batch rexx under TSO what's the easiest way to determine if a file is
'empty' -- i.e. has no records.

I cannot get LISTDSI to work and doing an EXECIO to read and check
records seems a waste.

???

bobh



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


-------------------------------------------------------------------------------------------
***National City made the following annotations
-------------------------------------------------------------------------------------------
This communication is a confidential and proprietary business communication.
It is intended solely for the use of the designated recipient(s). If this
communication is received in error, please contact the sender and delete
this communication.
===========================================================================================

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Mickey
2007-10-10 00:11:35 UTC
Permalink
And yet, EXECIO would be better. It would actually be faster, as there would
be no need to link to an external service (IDCAMS), or create a buffer
(OUTTRAP) and read it in and parse it out. EXECIO 1 DISKR is simply better
for Rexx.

Mickey

----- Original Message -----
From: "Jeff Byrum" <***@ASG.COM>
To: <TSO-***@VM.MARIST.EDU>
Sent: Tuesday, October 09, 2007 3:33 PM
Subject: Re: [TSO-REXX] empty file;


Just FYI, REPRO is also a TSO command (I think most, if not all, IDCAMS
commands are as well) so you can just invoke it directly from a REXX exec
running under TSO or ISPF (with ADDRESS TSO) without having to explicitly
allocate the datasets or create a SYSIN with queuing...

Jeff

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Dunkel, Martin
Sent: Tuesday, October 09, 2007 12:33 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

João,

Thank you for that. Now that I think back, it is IDCAMS, not Fileaid that
we use for this. An IDCAMS can very easily be incorporated in a Rexx
program by simply allocating the DD's, queuing the SYSIN and calling IDCAMS.
You can then check the rc coming back.

And, yes, this will only tell you the file is not empty. This will tell you
nothing about the validity of the data.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
João Luís Matos Carvalho (DSI)
Sent: Tuesday, October 09, 2007 12:05 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

FileAid is not necessary !
You can use this JCL STEP example below :

//TESTE001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//AMSDUMP DD SYSOUT=*
//DSFI DD DSN=PMTRFGR.FFS100.PWFSFMV1,DISP=SHR,
// BUFNO=10
//DSFO DD DUMMY,DCB=LRECL=266,RECFM=FB,DSORG=PS
//SYSIN DD *
REPRO INFILE(ENTRADA) OUTFILE(SAIDA) COUNT(1)
/*
//*

If RC = 0, isn't empty !

Atenciosamente,
João Carvalho
* - mailto:***@caixaseguros.pt
"Em momentos de crise, só a imaginação é mais importante que o conhecimento"
(Albert Einstein)
P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada
vez menos árvores
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Dunkel, Martin
Sent: terça-feira, 9 de Outubro de 2007 16:35
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

Robert,

What I have seen done (and I am pretty sure we have this in production)
is to run a FileAid (which you can code in Rexx) to copy 1 record of a
file. If you get a return code 8, then the file was empty. And, if you
get a return code 0, then there was something to copy.

If you need an example, I can try to search around.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Hamilton, Robert L
Sent: Tuesday, October 09, 2007 11:14 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] empty file;

In batch rexx under TSO what's the easiest way to determine if a file is
'empty' -- i.e. has no records.

I cannot get LISTDSI to work and doing an EXECIO to read and check
records seems a waste.

???

bobh



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


-------------------------------------------------------------------------------------------
***National City made the following annotations
-------------------------------------------------------------------------------------------
This communication is a confidential and proprietary business communication.
It is intended solely for the use of the designated recipient(s). If this
communication is received in error, please contact the sender and delete
this communication.
===========================================================================================

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2007-10-10 02:11:55 UTC
Permalink
In a recent note, Mickey said:

> Date: Tue, 9 Oct 2007 17:03:43 -0400
>
> And yet, EXECIO would be better. It would actually be faster, as there would
> be no need to link to an external service (IDCAMS), or create a buffer
> (OUTTRAP) and read it in and parse it out. EXECIO 1 DISKR is simply better
> for Rexx.
>
There's one annoying limitation: EXECIO will not deal with RECFM=U;
REPRO will. Once when I wanted to generate a RECFM=U data set, I
did EXECIO to RECFM=V[B], then REPRO to the RECFM=U. LMPUT will also
do RECFM=U, but at that time I was stymied by a bug; later fixed by
APAR.

-- gil
--
StorageTek
INFORMATION made POWERFUL

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Hamilton, Robert L
2007-10-10 11:41:38 UTC
Permalink
I wish FTP was the same as the IDCAMS stuff; Would make FTP a lot easier to deal with...

Does anyone run FTP from a REXX exec under TSO?

bobh

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Mickey
Sent: Tuesday, October 09, 2007 4:04 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

And yet, EXECIO would be better. It would actually be faster, as there would
be no need to link to an external service (IDCAMS), or create a buffer
(OUTTRAP) and read it in and parse it out. EXECIO 1 DISKR is simply better
for Rexx.

Mickey

----- Original Message -----
From: "Jeff Byrum" <***@ASG.COM>
To: <TSO-***@VM.MARIST.EDU>
Sent: Tuesday, October 09, 2007 3:33 PM
Subject: Re: [TSO-REXX] empty file;


Just FYI, REPRO is also a TSO command (I think most, if not all, IDCAMS
commands are as well) so you can just invoke it directly from a REXX exec
running under TSO or ISPF (with ADDRESS TSO) without having to explicitly
allocate the datasets or create a SYSIN with queuing...

Jeff

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Dunkel, Martin
Sent: Tuesday, October 09, 2007 12:33 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

João,

Thank you for that. Now that I think back, it is IDCAMS, not Fileaid that
we use for this. An IDCAMS can very easily be incorporated in a Rexx
program by simply allocating the DD's, queuing the SYSIN and calling IDCAMS.
You can then check the rc coming back.

And, yes, this will only tell you the file is not empty. This will tell you
nothing about the validity of the data.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
João Luís Matos Carvalho (DSI)
Sent: Tuesday, October 09, 2007 12:05 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

FileAid is not necessary !
You can use this JCL STEP example below :

//TESTE001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//AMSDUMP DD SYSOUT=*
//DSFI DD DSN=PMTRFGR.FFS100.PWFSFMV1,DISP=SHR,
// BUFNO=10
//DSFO DD DUMMY,DCB=LRECL=266,RECFM=FB,DSORG=PS
//SYSIN DD *
REPRO INFILE(ENTRADA) OUTFILE(SAIDA) COUNT(1)
/*
//*

If RC = 0, isn't empty !

Atenciosamente,
João Carvalho
* - mailto:***@caixaseguros.pt
"Em momentos de crise, só a imaginação é mais importante que o conhecimento"
(Albert Einstein)
P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada
vez menos árvores
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Dunkel, Martin
Sent: terça-feira, 9 de Outubro de 2007 16:35
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] empty file;

Robert,

What I have seen done (and I am pretty sure we have this in production)
is to run a FileAid (which you can code in Rexx) to copy 1 record of a
file. If you get a return code 8, then the file was empty. And, if you
get a return code 0, then there was something to copy.

If you need an example, I can try to search around.

Thanks! MPD

Martin Dunkel
National City Corporation
Turnover Support / ChangeMan ZMF
(w) 216-257-5354
(p) ***@archwireless.net

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Hamilton, Robert L
Sent: Tuesday, October 09, 2007 11:14 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] empty file;

In batch rexx under TSO what's the easiest way to determine if a file is
'empty' -- i.e. has no records.

I cannot get LISTDSI to work and doing an EXECIO to read and check
records seems a waste.

???

bobh



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


-------------------------------------------------------------------------------------------
***National City made the following annotations
-------------------------------------------------------------------------------------------
This communication is a confidential and proprietary business communication.
It is intended solely for the use of the designated recipient(s). If this
communication is received in error, please contact the sender and delete
this communication.
===========================================================================================

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Michael Bradley
2007-10-10 12:09:35 UTC
Permalink
Bob said,
Does anyone run FTP from a REXX exec under TSO?


Robert,

This reply is overkill, but shows a couple of things in context. This
snippet takes a list of DDNAMEs, obtains their SYSDSNAMEs via LISTDSI, to
populate function variables for a skeleton, and then checks for data in the
file before building the FTP control statements for that file. This exec
also determines the existence of a subdirectory in a known directory, and
creates it if it doesn't already exist. This exec runs in TSOBATCH.

Except for some minor editing for security purposes, this is a verbatim
copy and paste.

Michael
#9500_FTP:

Address 'TSO'
'MAKEBUF'
Queue 'WETCINTRANET1' /* Login */
Queue 'userid' 'password' /* Or use uerid.NETDATA, q.v. */
Queue 'CD \dsqa\S.Q.A\TEST\Projects' /* Known Existence */
Queue 'LS (DISK' /* List the subdirectories on DISK */
Queue 'QUIT'

'FTP -v (EXIT' /* Run to get LSOUTPUT onto DISK */
fRC = rc
Address 'TSO'
'DROPBUF'
If fRC > 0 then
Do
Say '#9500 FTP Dir failure; RC:' fRC
Exit fRC
End

"ALLOC FI(LSOUTPUT) DA('"userid()".FTP.LSOUTPUT') SHR REU"
If rc > 0 then
Do
Say '#9510 Dir ALLOC failure; RC:' RC
Exit RC
End
'EXECIO * DISKR LSOUTPUT (FINIS STEM in.'
'FREE FI(LSOUTPUT)' /* Done with LSOUTPUT */

Do i=1 to in.0 /* Scan LSOUTPUT for ProjCCID */
If pos(ProjCCID,in.i) > 0 then
Do
dirExist = 1
FTPdir = in.i
Leave i
End
End i

If i > in.0 then /* Directory not found; see below */
dirExist = 0

Do i=1 to words(ddl) /* FTP files with data */
aDD = word(ddl,i)
If aDD = 'DSNSTATS' then /* Skip FTPing this until later */
Iterate i
ldx = listdsi(aDD 'FILE')
If ldx > 0 then
Do
Say 'LISTDSI for' aDD 'returned RC:' ldx,
sysmsglvl2
maxRC = max(maxRC,ldx)
End
Else,
Do
FTPxx = 'FTP'substr(aDD,4) /* Create varname for STATS skel */
Interpret FTPxx "= 'N'" /* Ind NO file FTPed in STATS -so far */
Address 'TSO',
'EXECIO 1 DISKR' aDD '(FINIS STEM xx.'
If rc > 0 then /* No data in file, skip it */
Iterate i

Interpret FTPxx "= 'Y'" /* Indicate (Y) File FTPed in STATS */
Address 'TSO',
'MAKEBUF'
Queue 'WETCINTRANET1'
Queue 'userid' 'password' /* Or use uerid.NETDATA, q.v. */
Queue 'CD \dsqa\S.Q.A\TEST\Projects'
If dirExist then
Queue 'CD \dsqa\S.Q.A\TEST\Projects\'FTPdir
Else
Do
Queue 'MKDIR \dsqa\S.Q.A\TEST\Projects\'ProjCCID
Queue 'CD \dsqa\S.Q.A\TEST\Projects\'ProjCCID
dirExist = 1 /* Remember we created it */
FTPdir = ProjCCID /* and what it's called */
End
Queue 'ASCII'
Queue "PUT '"sysdsname"'" sysdsname'.TXT' /* DSN req's QUOTES */
Queue 'QUIT'

Address 'TSO',
'FTP -v (EXIT'
fRC = rc
Address 'TSO',
'DROPBUF'
If fRC > 0 then
Leave i
End
End i

Return

(Leave the -v in FTP -v ... lower case, and it will run on any FTP
service.)

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2007-10-10 12:13:05 UTC
Permalink
In a recent note, Hamilton, Robert L said:

> Date: Wed, 10 Oct 2007 06:40:22 -0500
>
> I wish FTP was the same as the IDCAMS stuff; Would make FTP a lot easier to deal with...
>
What are you looking for? A remote version of the IDCAMS "DEFINE ..." command?
This might be disallowed for security reasons. Anything else?

> Does anyone run FTP from a REXX exec under TSO?
>
I can't find where I've done this. IIRC, I've tried and been confused by
how FTP gets its command stream:

o Under TSO: from GETLINE (TGET? Will it read from Rexx stack?)

o Under shell: from stdin.

o Under batch: from DD INPUT.

But how does it tell? If I run it as "address ATTCHMVS FTP" from TSO or
shell, does that count as batch and read from INPUT? If I run it as
"address TSO FTP" under batch IKJEFT01 or shell, does that count as TSO
and do GETLINE? If I run it as "address SYSCALL spawnp ftp" under
TSO, IKJEFT01, or IRXJCL, does that count as shell and read from stdin?

Etc. I get confused and give up. I believe TFM does little to clarify
this.

-- gil
--
StorageTek
INFORMATION made POWERFUL

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Arthur T.
2007-10-10 00:19:01 UTC
Permalink
On 9 Oct 2007 16:12:06 -0700, in bit.listserv.tsorexx
(Message-ID:<***@UTDEVS08.campus.ad.utdallas.edu>)
***@UTDALLAS.EDU (Hamilton, Robert L) wrote:

>And the winner is
>
>"repro INFILE(nofiller) Outfile(sysprint)"
>SAY RETURN CODE IS RC
>
>With no recs you get a rc = 12 otoh you get rc = 0

And if the file is gigabytes, you get a hell of a
bottleneck. Instead, how about:
"repro INFILE(nofiller) Outfile(sysprint) count(1)"

--
I cannot receive mail at the address this was sent from.
To reply directly, send to ar23hur "at" intergate "dot" com

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Mickey
2007-10-10 00:52:49 UTC
Permalink
How about EXECIO 1 DISKR?

Mickey

----- Original Message -----
From: "Arthur T." <***@INTERGATE.COM>
To: <TSO-***@VM.MARIST.EDU>
Sent: Tuesday, October 09, 2007 8:14 PM
Subject: Re: [TSO-REXX] empty file;


> On 9 Oct 2007 16:12:06 -0700, in bit.listserv.tsorexx
> (Message-ID:<***@UTDEVS08.campus.ad.utdallas.edu>)
> ***@UTDALLAS.EDU (Hamilton, Robert L) wrote:
>
>>And the winner is
>>
>>"repro INFILE(nofiller) Outfile(sysprint)"
>>SAY RETURN CODE IS RC
>>
>>With no recs you get a rc = 12 otoh you get rc = 0
>
> And if the file is gigabytes, you get a hell of a
> bottleneck. Instead, how about:
> "repro INFILE(nofiller) Outfile(sysprint) count(1)"
>
> --
> I cannot receive mail at the address this was sent from.
> To reply directly, send to ar23hur "at" intergate "dot" com
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
>

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Hamilton, Robert L
2007-10-10 11:41:19 UTC
Permalink
That's a good idea; thnx

bobh

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Arthur T.
Sent: Tuesday, October 09, 2007 7:14 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: empty file;

On 9 Oct 2007 16:12:06 -0700, in bit.listserv.tsorexx
(Message-ID:<***@UTDEVS08.campus.ad
.utdallas.edu>)
***@UTDALLAS.EDU (Hamilton, Robert L) wrote:

>And the winner is
>
>"repro INFILE(nofiller) Outfile(sysprint)"
>SAY RETURN CODE IS RC
>
>With no recs you get a rc = 12 otoh you get rc = 0

And if the file is gigabytes, you get a hell of a
bottleneck. Instead, how about:
"repro INFILE(nofiller) Outfile(sysprint) count(1)"

--
I cannot receive mail at the address this was sent from.
To reply directly, send to ar23hur "at" intergate "dot" com

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Robert Zenuk
2007-10-10 18:03:48 UTC
Permalink
Ahhhh... Back from vacation and wading through email...

To follow-up on the empty file topic, I use EXECIO when I know for sure it
is a sequential file (or member of a PDS). I use the PRINT COUNT(1) technique
when I write utilities that can accept either SEQ or VSAM. Here is some
logic that handles SEQ and VSAM and deals with an empty file that contains a
"seed" record or a known number of "header" records.

/* rexx */
arg dsn count
if count = '' then count = 0
count = count + 1
dsn = strip(dsn,"B","'")
"ALLOC F(EMPTY) DA('"dsn"') SHR REUSE"
call outtrap 'msgs.'
"PRINT INFILE(EMPTY) COUNT("count")"
PRC = RC
select
when PRC = 0 then exit 0
when PRC = 4 then
do
if count > 1 then
do
count = count - 1
"PRINT INFILE(EMPTY) COUNT("count")"
if RC = 0 then
exit 1
end
else
exit 2
end
otherwise
do
do i=1 to msgs.0
select
when pos('RETURN CODE IS 160',msgs.i) <> 0 then
exit 2
otherwise nop
end
end
exit PRC
end
end
"FREE F(EMPTY)"

Here are some quick and dirty examples of using FTP from REXX (forground or
background). There are at least 3 approaches to this (that I know of). The
traditional QUEUE approach, the ALLOCATE INPUT OUTPUT approach and the new
FTP REXX API that appears with z/OS 1.8. All are very well documented in the
manuals with usable examples. If you don't think so, here are a couple more
examples.

FTP EXEC Interface

_http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B960/4.10?SHEL
F=F1A1BK81&DT=20060622162500_
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B960/4.10?SHELF=F1A1BK81&DT=20060622162500)

FTP REXX API

_http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/f1a1d360/12.10?SHE
LF=F1A1BK81.bks&DT=20060622161331#HDRWQ450_
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/f1a1d360/12.10?SHELF=F1A1BK81.bks&DT=20060622161331#
HDRWQ450)

In all examples the UserID and Password can be placed in a NETRC DD
pre-allocated to the session or in the EXEC. In batch adding a NETRC DD does the
same thing. NETRC avoids typing in the Userid and Password details and allows
you to create a secure DSN/PDS with these sensitive pieces of information.
This is also well documented in the manuals. While the NETRC approach does
avoid the Userid Password issue for the user, it does not solve the traditional
FTP security issue of unencrypted passwords flying across the wire. Look at
SFTP for that.


NETRC

_http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/f1a1b960/10.2?SHEL
F=F1A1BK81&DT=20060622162500_
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/f1a1b960/10.2?SHELF=F1A1BK81&DT=20060622162500)


Always use the "(EXIT" option with FTP. This causes FTP to return a REAL
return code. The return codes also are well documented.

_http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/f1a1b960/4.11?SHEL
F=F1A1BK81&DT=20060622162500_
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/f1a1b960/4.11?SHELF=F1A1BK81&DT=20060622162500)

Obviously, it can be extremely valuable knowing what happened and can save
time. This can also allow you to perform some recovery actions in REXX when
possible.



Here are some quick and dirty FTP examples (sorry if the indenting gets lost
during transmission):

The traditional QUEUE approach. Simply QUEUE the FTP subcommands and
execute FTP

arg uid pw dsn file ipaddr
queue uid pw
dsn = "'"strip(dsn,"B","'")"'"
queue "put" dsn file
queue "quit"
"FTP" ipaddr "(EXIT"
say RC

Loading subcommands from an INPUT DD (no OUTPUT DD)

arg uid pw dsn file ipaddr
dsn = "'"strip(dsn,"B","'")"'"
input.1 = uid pw
input.2 = "put" dsn file
input.3 = "quit"
"ALLOC F(INPUT) UNIT(VIO) SPACE(1 1) TRACKS LRECL(80)"
"EXECIO * DISKW INPUT (STEM INPUT. FINIS"
"FTP -i" ipaddr "(EXIT"
say RC

Loading INPUT and interrogating OUTPUT (using a DIR listing in this example)

arg uid pw dsn mem ipaddr
if ipaddr = '' then ipaddr = '127.0.0.1'
input.1 = uid pw
input.2 = "cd '"dsn"'"
input.3 = 'dir'
input.4 = 'QUIT'
"ALLOC F(INPUT) UNIT(VIO) LRECL(80) SPACE(1) TRACKS RECFM(F B)"
"EXECIO * DISKW INPUT (STEM INPUT. FINIS"
"ALLOC F(OUTPUT) UNIT(VIO) LRECL(121) SPACE(1 10) CYLINDERS RECFM(V B)"
"FTP" ipaddr "(EXIT"
if RC <> 0 then exit(RC)
"EXECIO * DISKR OUTPUT (STEM OUTPUT. FINIS"
do i=1 to output.0
parse var output.i msgid dirline
if mem = '' then
do
if msgid = 'EZA2284I' then say dirline
end
else
do
if msgid = 'EZA2284I' & word(dirline,1) = mem then say dirline
end
end
"FREE F(INPUT OUTPUT)"

In production code, you should develop a technique to read/parse the OUTPUT
DD to know what happened. This works very well. I have a standard
subroutine I developed to do this for me whenever I need FTP services in an EXEC.
Aside from the return code, this can tell you in English what happened.

The FTP REXX API has an example in your SYS1.SEZAINST, member name EZAFTPIR.
While the FTP REXX API looks really rich, I have not gotten around to
trying this other than a tailored copy of the example. The example is very
similar to the directory list example above. I stripped out all the extra "stuff"
and reduced all wait times on the IBM example and it still seems to run about
10 times slower than my example above. I'm not passing judgement yet, but
the early experimentation did not provide encouraging results.

TRACEID = 'REZ'
USER_COMMAND = 'user UID'
PASS_COMMAND = 'pass PW'
CD_COMMAND = "cd 'YOUR.PDS'"
DIR_COMMAND = 'dir *'
OPENSTRING = '-w 1 127.0.0.1 21 '
ENVVAR1 = '_CEE_DMPTARG=/tmp'
ENVVAR2 = '_BPX_JOBNAME=MYJOB'
if ftpapi('fcai.', 'create', TRACEID) < 0 then do
Say 'Unable to create the FCAI'
exit -1
end
if ftpapi('fcai.', 'init', OPENSTRING, ENVVAR1, ENVVAR2) < 0 then do
call ftp_error 'fcai.'
end
if ftpapi('fcai.', 'scmd', USER_COMMAND, 'W') < 0 then do
call ftp_error 'fcai.'
end
if fcai.FCAI_Result = FCAI_RESULT_PROMPTPASS then do
if ftpapi('fcai.', 'scmd', PASS_COMMAND, 'W') < 0 then do
call ftp_error 'fcai.'
end
end
if ftpapi('fcai.', 'scmd', CD_COMMAND, 'W') < 0 then do
call ftp_error 'fcai.'
end
if ftpapi('fcai.', 'scmd', DIR_COMMAND, 'W') < 0 then do
call ftp_error 'fcai.'
end
if ftpapi('fcai.', 'getl_copy', 'lines.', 'L') < 0 then do
call ftp_error 'fcai.'
end
say 'Directory output is:'
do i=1 to lines.0
say ' 'lines.i
end
if ftpapi('fcai.', 'scmd', 'QUIT', 'W') < 0 then do
call ftp_error 'fcai.'
end
if ftpapi('fcai.', 'term') < 0 then do
Say "Unexpected error on ftpapi('term')"
exit -1
end
exit
ftp_error: arg stem
say 'FTP Client API Error:'
say ' Result =' value(stem'FCAI_Result')
say ' Status =' value(stem'FCAI_Status')
say ' IE =' value(stem'FCAI_IE')
say ' CEC =' value(stem'FCAI_CEC')
say ' ReturnCode =' value(stem'FCAI_ReturnCode')
say ' ReasonCode =' value(stem'FCAI_ReasonCode')
rc = ftpapi('fcai.', 'term')
exit -1
return

I also have some FTP utilities I have written over the years for various
purposes.

FTPPUT Batch FTP utility supports, SEQ, GDG, PDS, VSAM (REPRO's to
SEQ) and HFS/zFS
@FTPGET ISPF Edit Macro to FTP GET into a member
@FTPPUT ISPF Edit Macro to FTP PUT an Edit session somewhere

Hope this helps,

Rob



In a message dated 10/10/2007 5:13:22 AM US Mountain Standard Time,
***@UNIX.STORTEK.COM writes:

In a recent note, Hamilton, Robert L said:

> Date: Wed, 10 Oct 2007 06:40:22 -0500
>
> I wish FTP was the same as the IDCAMS stuff; Would make FTP a lot easier
to deal with...
>
What are you looking for? A remote version of the IDCAMS "DEFINE ..."
command?
This might be disallowed for security reasons. Anything else?

> Does anyone run FTP from a REXX exec under TSO?
>
I can't find where I've done this. IIRC, I've tried and been confused by
how FTP gets its command stream:

o Under TSO: from GETLINE (TGET? Will it read from Rexx stack?)

o Under shell: from stdin.

o Under batch: from DD INPUT.

But how does it tell? If I run it as "address ATTCHMVS FTP" from TSO or
shell, does that count as batch and read from INPUT? If I run it as
"address TSO FTP" under batch IKJEFT01 or shell, does that count as TSO
and do GETLINE? If I run it as "address SYSCALL spawnp ftp" under
TSO, IKJEFT01, or IRXJCL, does that count as shell and read from stdin?

Etc. I get confused and give up. I believe TFM does little to clarify
this.

-- gil
--
StorageTek
INFORMATION made POWERFUL

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX







************************************** See what's new at http://www.aol.com

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Lindy Mayfield
2007-10-12 09:31:45 UTC
Permalink
Does anyone have any Rexx that can call ERBSMFI? If possible I'd like
to call it from Rexx, otherwise I can write it as a Rexx function
(unless that's already been done by someone.) (-:

I'm really looking to get the CPU% time used by an address space. Not
sure if it is easier to use ERBSMFI or calculate it from the OUCB, but
from my queries on IBM-MAIN ERBSMFI is the way to go.

Thanks!
Lindy

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Loading...