Re: unix commands in batch and su

2023-06-13 Thread Andy Styles
The way I've done it is to 'echo' the commands together as one long string, and 
then pipe that to su:

//RUNEXEC PGM=BPXBATCH
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//STDIN  DD DUMMY
//STDPARM DD *
SH
   echo 'echo "Starting" ;
   cd / ;
   ls -la ;
   id ; 
   echo "Ending" ' | su

Note that the entire 'script' is within single quotes so you need to escape any 
single quotes you need inside. 

STDPARM is great for this because it automatically concatenates the lines 
together with the need for continuation characters.

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


Re: Format PDS unloaded on an CD

2021-04-19 Thread Andy Styles
What was the format (recfm, blksize, lrecl, dsorg) of the zOS dataset that
you uploaded the CD copy to?

Andy.


On Mon, 19 Apr 2021, 10:04 Hilario Garcia,  wrote:

> Hello,
>
> Thank you very much for your answer. I had already tried the solution you
> recommended and it gave me the following problem:
>
> IEBCOPY  COPY  INDD=SYSUT1,OUTDD=SYSUT2 GENERATED STATEMENT
>
> IEB1128I *** COPYR1 (1ST PDSU PHYSICAL RECORD)
>
>   0094A0 FFF8    7FE4 7FE0  |"U  "\  |
>
>   0094B0 0008  00CA6D0F 020018B0 00509000 00807FF8  |  _  &"8|
>
>   0094C0 0018  3030200F 7FF8 2721000F E5A2  |  "8Vs  |
>
>   0094D0 0028  2252 0002006B 00DE 0080  |   ,|
>
>   0094E0 0038  01000B07 6930 7F00 80807FF8  |" "8|
>
>   0094F0 0048  8800 0011F000 6540 7FE4  |  h   0   "U|
>
>   009500 0058  0200 94E8 6570 0C14  |  mY|
>
>   009510 0068  6568 8800    |  h |
>
>   009520 0078   16000400 0611F000 20007FF8  |  0   "8|
>
>   009530 0088       ||
>
>   009540 0098       ||
>
> IEB120I SYSUT1   VALIDATION ERROR
>
> IEB178I NOT AN IEBCOPY UNLOADED DATA SET - 1ST PHYSICAL RECORD NOT 64 BYTES
> LONG
> IEB1030I DDNAME SYSUT1   REFERS TO PDSU DATA SET ON VOLUME SS NAMED
> IBMUSER.
> IEB1030I DDNAME SYSUT2   REFERS TO PDS  DATA SET ON VOLUME SS NAMED
> IBMUSER.
> IEB166I NO MEMBERS LOADED TO DATA SET REFERENCED BY SYSUT2
>
> IEB151I JOB HAS TERMINATED WITH ERROR(S)
>
> IEB147I END OF JOB - 8 WAS HIGHEST SEVERITY CODE
>
>
> Do you recommend any other possible solution.
>
> Thank you very much in advance.
>
> Kind Regards
>
> Hilario
>
> El lun, 19 abr 2021 a las 10:29, Styles, Andy (ITS zPlatform Services) (<
> 00d68f765d25-dmarc-requ...@listserv.ua.edu>) escribió:
>
> > Classification: Public
> >
> > I wonder if these are IEBCOPY unload format - that is, IEBCOPY from a PDS
> > to a PS.  It's been years since I had to deal with those, probably since
> I
> > installed products directly from a vendor tape (one of those round things
> > with the write-protect ring).
> >
> > IEBCOPY seems to create unload format dasd datasets (here, at least) as
> >
> > Organization  . . . : PS
> > Record format . . . : VS
> > Record length . . . : 32736
> > Block size  . . . . : 32740
> >
> > Worth uploading one of those files as binary and then using an IEBCOPY PS
> > to PDS to reload it?
> >
> > Andy Styles
> > z/Series System Programmer
> >
> > -Original Message-
> > From: IBM Mainframe Discussion List  On Behalf
> > Of Hilario Garcia
> > Sent: 19 April 2021 06:42
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > Subject: Fwd: Format PDS unloaded on an CD
> >
> > -- This email has reached the Bank via an external source --
> >
> >
> > -- Forwarded message -
> > De: Hilario Garcia 
> > Date: lun, 19 abr 2021 a las 7:40
> > Subject: Format PDS unloaded on an CD
> > To: 
> >
> >
> > Hello,
> >
> > Thank you very much for your contributions.
> > I have done multiple tests with different utilities (XMIT, FTP, IND $
> FILE,
> > AMATERSE) and I have not been able to download them in a valid format.
> > Attached I send in hexadecimal format the beginning of one of the PDS
> > (loaded as FB, lrecl = 80) and it seems that at the beginning of the file
> > is the directory of a PDS partitioned file. If the file is loaded as FB
> and
> > 80 bytes long, you can see the code in EBCDIC format. The original file
> is
> > in format binary and I have loaded it in binary.
> >
> > I would appreciate your help in this regard.
> >
> > Thank you very much in advance.
> >
> > Kind Regards
> >
> > Hilario
> >
> >
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions, send
> email
> > to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions, send
> email
> > to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> > Lloyds Banking Group plc. Registered Office: The Mound, Edinburgh EH1
> 1YZ.
> > Registered in Scotland no. 

Re: Request for help with removing sequence numbers from PDS members

2021-01-12 Thread Andy Styles
Whilst this basically true, you can have the same REXX invoked as a macro
using the technique I used.

Wrapping ISREDIT MACRO in CONTROL ERRORS allows you to get the RC20 if it's
not running under Edit (and obviously any other major reasons) , this
enabling you to determine which path through the program you need to take.

If you call other edit macros from within an edit macro when both have
ISREDIT MACRO coded, you also get the RC20. Again wrapping that in CONTROL
ERRORS allows you to use a macro as a user command as well as calling it
from other macros.

Andy

On Tue, 12 Jan 2021, 16:20 Seymour J Metz,  wrote:

> ISREDIT is only valid for an edit macro. You need on script to invoke EDIT
> and a second script running as an IMACRO for the edit. If they are in
> SYSPROC then you need to start the first comment with REXX.
>
>/* Outer script */
>   parse upper arg dataset
>   "CONTROL ERRORS RETURN"
>   'EDIT DATASET('dataset') MACRO(STRIPED')'
>   /* Tailor above to suit your needs */
>
>   /* Inner script */
>   'CONTROL ERRORS RETURN'
>  ADDRESS ISREDIT
>   'UNNUMBER'
>   'SAVE'
>  'END'
>
>
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
> 
> From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf
> of Sean Gleann [sean.gle...@gmail.com]
> Sent: Tuesday, January 12, 2021 5:30 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: Request for help with removing sequence numbers from PDS
> members
>
> I've been told by Powers That Be that this line of development is redundant
> & that a different solution has been independently developed elsewhere in
> the company. (*sigh* - 'twas ever thus)
> But I'm still interested in discovering what I'm doing wrong.
> To that end, here's the jobstream I'm using, in the hope that someone can
> pin-point the problem:
> (I do so hope that this comes through without being reformatted by various
> e-mail servers...)
>
> 
> //RUNREXX  EXEC PGM=IKJEFT01
> //SYSTSPRT DD   SYSOUT=*
> //ISPMLIB  DD   DSN=ISP.SISPMENU,DISP=SHR
> //ISPPLIB  DD   DSN=ISP.SISPPENU,DISP=SHR
> //ISPSLIB  DD   DSN=ISP.SISPSLIB,DISP=SHR
> //ISPTLIB  DD   DSN=ISP.SISPTENU,DISP=SHR
> //ISPPROF  DD   DISP=(NEW,PASS),SPACE=(TRK,(1,1,1)),
> //  DSORG=PO,RECFM=FB,BLKSIZE=27920,LRECL=80
> //SYSEXEC  DD   DSN=,DISP=SHR
> //SYSTSIN  DD   *
> ISPSTART CMD(STRIPNOS )
>
> and here is the first part of the STRIPNOS REXX program - such as it is
> right now:
>
> /* REXX to strip line numbers in place */
> /* trace i */
> parse source
> arg dataset
> say "PDS to be modified:" dataset
> "ISPEXEC CONTROL ERRORS RETURN"
> "ISREDIT MACRO"
> edMac = rc
> "ISPEXEC CONTROL ERRORS CANCEL"
>  (followed by the rest of Andy's solution, currently all commented out)
>
>
>  ** Mark well that phrase 'as it is right now'. As I've already detailed,
> I've tried many different variants of this code to try and get something
> working, with a notable lack of success
>
> Regards
> Sean
>
> On Mon, 11 Jan 2021 at 20:03, Lennie Dymoke-Bradshaw <
> 032fff1be9b4-dmarc-requ...@listserv.ua.edu> wrote:
>
> > Apologies, you wanted to do a PDS member.
> >
> > //EDIT EXEC  PGM=IKJEFT01
> > //SYSTSPRT  DD   SYSOUT=*
> > //SYSTSIN   DD   *
> >EDIT 'LEN.X.TEST.NVSAM.PDS(#ASM)' DATA
> >LIST
> >UNNUM
> >LIST
> >END SAVE
> > /*
> > //
> >
> > Note the LIST commands are optional.
> > Lennie
> >
> > -Original Message-
> > From: IBM Mainframe Discussion List  On Behalf
> > Of Lennie Dymoke-Bradshaw
> > Sent: 11 January 2021 19:48
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > Subject: Re: Request for help with removing sequence numbers from PDS
> > members
> >
> > Here's how to do it using TSO EDIT.
> >
> > //EDIT EXEC  PGM=IKJEFT01
> > //SYSTSPRT  DD   SYSOUT=*
> > //SYSTSIN   DD   *
> >EDIT 'LEN.X.TEST.NVSAM.FB80' DATA
> >LIST
> >UNNUM
> >LIST
> >END SAVE
> > /*
> > //
> >
> > Lennie
> >
> > -Original Message-
> > From: IBM Mainframe Discussion List  On Behalf
> > Of Lennie Bradshaw
> > Sent: 11 January 2021 12:26
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > Subject: Re: Request for help with removing sequence numbers from PDS
> > members
> >
> > How about TSO EDIT (yes TSO, not ISPF) in batch.
> > Lennie
> >
> > -Original Message-
> > From: IBM Mainframe Discussion List  On Behalf
> > Of R.S.
> > Sent: 11 January 2021 10:21
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > Subject: Re: Request for help with removing sequence numbers from PDS
> > members
> >
> > W dniu 11.01.2021 o 10:05, Sean Gleann pisze:
> > > This has almost certainly cropped up before but try as I might, I
> > > can't spot anything obvious in the archives.
> > >
> > > I have a need to strip sequence numbers from members in a PDS or PDSE.
> > > The input PDS(E) has DCB characteristics of REFCM=FB,LRECL-80, and
> > > contains an unknown number of members. Of those members, some will
> > > have records with 'old data' in character positions 73-80 (that is -
> 

Re: Request for help with removing sequence numbers from PDS members

2021-01-12 Thread Andy Styles
Actually, I think it does.

The MACRO parameter should have the name of the calling exec - the other
parms have values as I would expect.

Can you add a trace ir right at the top,  it should show what the parse
source is returning; you might instead add a say me ..

The parse line should say:

parse source . . me .

Andy

On Tue, 12 Jan 2021, 13:16 Sean Gleann,  wrote:

> Hi Andy
>
> The ISPLOG output doesn't give anything useful, unfortunately.
>
> Time*** ISPF transaction log ***
>
>
> 07:08   Start of ISPF Log - - -  - Session # 1
> 
> 07:08  TSO - Command  -  - STRIPNOS 
>
> 07:08   * Dialog Error * - Application(ISP); Function Command
> (STRIPNOS); Service(EDIT)
> 07:08  Line from cmd:- EDIT DATAID(ISR1) MEMBER(TEST1)
> MACRO()  <<'TEST1' is the name of the first
> member in the incoming PDS, though.
> 07:08  BDISPMAX exceeded - 100 displays exceeded in batch mode on
> panel
>
> Regards
> Sean
>
> On Tue, 12 Jan 2021 at 12:56, Sri h Kolusu  wrote:
>
> > Sean,
> >
> > If your shop has File-manager , the following JCL will give you the
> desired
> > results
> >
> > //STEP0100 EXEC PGM=FILEMGR
> > //SYSPRINT DD SYSOUT=*
> > //PDS  DD DISP=SHR,DSN=Your.PDS/PDSE.to.remove.seqnum
> > //SYSINDD *
> > $$FILEM FCH INPUT=PDS
> > C  P'=' ' ' 73 80
> > /*
> >
> >
> > Thanks,
> > Kolusu
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

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


Re: Request for help with removing sequence numbers from PDS members

2021-01-12 Thread Andy Styles
So, it's the invocation of EDIT that's causing the error.

If you add an ISPLOG DD (RECFM VBA, LRECL 125) do you get more info?

Otherwise we're into adding some say statements in to see what ,
 and  are set to, and wrapping the whole thing in CONTROL ERRORS
so we can see what we get back in ZERRLM after the failure.

I did say it did limited error handling 

Andy



On Tue, 12 Jan 2021, 11:27 Sean Gleann,  wrote:

> Hi Andy
>
> "is it just that you're seeing the RC20 from the ISREDIT" - in this
> particular version of the REXX it is, but as previously detailed I had
> problems with the syntax of the CONTROL ERRORS statement.
> "Does the REXX continue afterwards if you uncomment the code" - in a manner
> of speaking, yes. The whole job terminates with RC990.
> Here's the SYSTSPRT produced by running the uncommented REXX, with 'trace
> i' specified:
>
>  3 *-* parse source
>
>  4 *-* arg dataset
>
>>>>   "**"
>
>  5 *-* say "PDS to be modified:" dataset
>
>>L>   "PDS to be modified:"
>
>>V>   "**"
>
>>O>   "PDS to be modified: **"
>
> PDS to be modified: **
>
>  6 *-* "ISPEXEC CONTROL ERRORS RETURN"
>
>>L>   "ISPEXEC CONTROL ERRORS RETURN"
>
>  7 *-* "ISREDIT MACRO"
>
>>L>   "ISREDIT MACRO"
>
>+++ RC(20) +++
>
>  8 *-* edMac = rc
>
>>V>   "20"
>
>  9 *-* "ISPEXEC CONTROL ERRORS CANCEL"
>
>>L>   "ISPEXEC CONTROL ERRORS CANCEL"
>
> 10 *-* if edMac = 0
>
>>V>   "20"
>
>>L>   "0"
>
>>O>   "0"
>
> 14 *-* "ISPEXEC LMINIT DATAID(DSN) DATASET('"dataset"') ENQ(SHR)"
>
>>L>   "ISPEXEC LMINIT DATAID(DSN) DATASET('"
>
>>V>   "**"
>
>>O>   "ISPEXEC LMINIT DATAID(DSN) DATASET('**"
>
>>L>   "') ENQ(SHR)"
>
>>O>   "ISPEXEC LMINIT DATAID(DSN) DATASET('**')
> ENQ(SHR)"
> 15 *-* "ISPEXEC LMOPEN DATAID()"
>
>>L>   "ISPEXEC LMOPEN DATAID()"
>
> 16 *-* Do until RC > 0
>
> 17 *-*  "ISPEXEC LMMLIST DATAID() OPTION(LIST) MEMBER(MEMBER)
> STATS(NO)"
>>L>"ISPEXEC LMMLIST DATAID() OPTION(LIST) MEMBER(MEMBER)
> STATS(NO)"
> 18 *-*  If RC = 8
>
>>V>"0"
>
>>L>"8"
>
>>O>"0"
>
> 20 *-*  If RC = 0
>
>>V>"0"
>
>>L>"0"
>
>>O>"1"
>
>*-*   Then
>
> 21 *-*   "ISPEXEC EDIT DATAID() MEMBER() MACRO()"
>
>>L> "ISPEXEC EDIT DATAID() MEMBER() MACRO()"
>
>   ISPP330 BDISPMAX exceeded   -/-100 displays exceeded in batch mode on
> panel
>
> Regards
> Sean
>
> On Tue, 12 Jan 2021 at 11:06, Andy Styles  wrote:
>
> > Twice recently I've tried to paste an answer to a question involving some
> > REXX output and been caught by our DLP filters.
> >
> > Subscribing separately to avoid that!
> >
> > Anyway, is it just that you're seeing the RC20 from the ISREDIT?
> >
> > I would expect that on the first invocation, the CONTROL ERRORS  wrapper
> > is there to stop ISPF terminating the exec with a severe error.
> >
> > Does the REXX continue afterwards if you uncomment the code?
> >
> > Andy
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

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


Re: Request for help with removing sequence numbers from PDS members

2021-01-12 Thread Andy Styles
Twice recently I've tried to paste an answer to a question involving some REXX 
output and been caught by our DLP filters.

Subscribing separately to avoid that!

Anyway, is it just that you're seeing the RC20 from the ISREDIT?

I would expect that on the first invocation, the CONTROL ERRORS  wrapper is 
there to stop ISPF terminating the exec with a severe error. 

Does the REXX continue afterwards if you uncomment the code?

Andy

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