Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-24 Thread Hobart Spitz
Incorrect.

You use a pipe-fitting on the JCL DD, something like "bpread | sysout q | >
dd=out2 | > dd=out3" for as many outputs as you like.

I'm iffy on the exact syntax for specifying the stream separator, but the
fanout stage can do the same:
   "(end ?) bpread | fo: fanout | sysout q ? fo: | dd=out2 ? fo: | dd=out3"

If you wanted to remove ASA page feeds from, say the last output.
   "(end ?) bpread | fo: fanout | sysout q ? fo: | > dd=out2 ? fo: |
change 1 /1/ / | > dd=out3"

In other words, you have all of CMS/TSO Pipelines available to your, except
full-screen I/O.

Use PipeThink.  You'll never go back.

OREXXMan
JCL is the buggy whip of 21st century computing.  Stabilize it.
Put Pipelines in the z/OS base.  Would you rather process data in move mode
or locate mode?
IBM has been looking for an HLL for program products; REXX is that language.


On Wed, Sep 23, 2020 at 1:23 PM Martin Packer 
wrote:

> No, that would have to be another job, also specifying eg SUBSYS=PIPE. And
> scheduled to run alongside the sort.
>
> Cheers, Martin
>
> Martin Packer
>
> Systems Investigator & Performance Troubleshooter, IBM
>
> +44-7802-245-584
>
> email: martin_pac...@uk.ibm.com
>
> Twitter / Facebook IDs: MartinPacker
>
> Blog: https://mainframeperformancetopics.com
>
> Mainframe, Performance, Topics Podcast Series (With Marna Walle):
> https://anchor.fm/marna-walle
>
> Youtube channel: https://www.youtube.com/channel/UCu_65HaYgksbF6Q8SQ4oOvA
>
>
>
> From:   Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
> To: IBM-MAIN@LISTSERV.UA.EDU
> Date:   23/09/2020 17:18
> Subject:[EXTERNAL] Re: SORT question: How to both remove records
> from a file AND write removed records to a 2nd output?
> Sent by:IBM Mainframe Discussion List 
>
>
>
> On Wed, 23 Sep 2020 16:01:08 +0100, Martin Packer wrote:
>
> >Right. That example used BatchPipes/MVS pipes - but it's not essential to
> >the use of OUTFIL SPLIT. The reason it used pipes was to enable cloning
> to
> >balance a pipe.
> >
> OK.  I looked at your example (z/OS 2.1; not too misty).  But what
> mystifies
> me is where to code the Pipeline specification.  Suppose I want to, for
> example to direct OUT1 (or an added OUT3) to a stage such as
> DIGEST MD5.  Could I just code:
>...,SUBSYS='PIPE,DIGEST MD5',...
> ??? if not, how?  And can I further direct that digest to SYSOUT?
>
> >-Original Message-
> >From: IBM Martin Packer
> >Sent: Wednesday, September 23, 2020 4:31 AM
> >...
> >Something also from the mists of time, by no coincidence, is this:
> >
>
> https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.icea100/ice2ca_Example_11._Sort_with_Pipes_and_OUTFIL_SPLIT.htm
>
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
> --
> 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: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-23 Thread Martin Packer
No, that would have to be another job, also specifying eg SUBSYS=PIPE. And 
scheduled to run alongside the sort.

Cheers, Martin

Martin Packer

Systems Investigator & Performance Troubleshooter, IBM

+44-7802-245-584

email: martin_pac...@uk.ibm.com

Twitter / Facebook IDs: MartinPacker

Blog: https://mainframeperformancetopics.com

Mainframe, Performance, Topics Podcast Series (With Marna Walle): 
https://anchor.fm/marna-walle

Youtube channel: https://www.youtube.com/channel/UCu_65HaYgksbF6Q8SQ4oOvA



From:   Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
To: IBM-MAIN@LISTSERV.UA.EDU
Date:   23/09/2020 17:18
Subject:[EXTERNAL] Re: SORT question: How to both remove records 
from a file AND write removed records to a 2nd output?
Sent by:IBM Mainframe Discussion List 



On Wed, 23 Sep 2020 16:01:08 +0100, Martin Packer wrote:

>Right. That example used BatchPipes/MVS pipes - but it's not essential to
>the use of OUTFIL SPLIT. The reason it used pipes was to enable cloning 
to
>balance a pipe.
> 
OK.  I looked at your example (z/OS 2.1; not too misty).  But what 
mystifies
me is where to code the Pipeline specification.  Suppose I want to, for
example to direct OUT1 (or an added OUT3) to a stage such as
DIGEST MD5.  Could I just code:
   ...,SUBSYS='PIPE,DIGEST MD5',...
??? if not, how?  And can I further direct that digest to SYSOUT?

>-Original Message-
>From: IBM Martin Packer
>Sent: Wednesday, September 23, 2020 4:31 AM
>...
>Something also from the mists of time, by no coincidence, is this:
>
https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.icea100/ice2ca_Example_11._Sort_with_Pipes_and_OUTFIL_SPLIT.htm


-- gil

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




Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-23 Thread Paul Gilmartin
On Wed, 23 Sep 2020 16:01:08 +0100, Martin Packer wrote:

>Right. That example used BatchPipes/MVS pipes - but it's not essential to
>the use of OUTFIL SPLIT. The reason it used pipes was to enable cloning to
>balance a pipe.
> 
OK.  I looked at your example (z/OS 2.1; not too misty).  But what mystifies
me is where to code the Pipeline specification.  Suppose I want to, for
example to direct OUT1 (or an added OUT3) to a stage such as
DIGEST MD5.  Could I just code:
   ...,SUBSYS='PIPE,DIGEST MD5',...
??? if not, how?  And can I further direct that digest to SYSOUT?

>-Original Message-
>From: IBM Martin Packer
>Sent: Wednesday, September 23, 2020 4:31 AM
>...
>Something also from the mists of time, by no coincidence, is this:
>https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.icea100/ice2ca_Example_11._Sort_with_Pipes_and_OUTFIL_SPLIT.htm

-- gil

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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-23 Thread Martin Packer
Right. That example used BatchPipes/MVS pipes - but it's not essential to 
the use of OUTFIL SPLIT. The reason it used pipes was to enable cloning to 
balance a pipe.

Cheers, Martin

Martin Packer

Systems Investigator & Performance Troubleshooter, IBM

+44-7802-245-584

email: martin_pac...@uk.ibm.com

Twitter / Facebook IDs: MartinPacker

Blog: https://mainframeperformancetopics.com

Mainframe, Performance, Topics Podcast Series (With Marna Walle): 
https://anchor.fm/marna-walle

Youtube channel: https://www.youtube.com/channel/UCu_65HaYgksbF6Q8SQ4oOvA



From:   "Farley, Peter x23353" 
<031df298a9da-dmarc-requ...@listserv.ua.edu>
To: IBM-MAIN@LISTSERV.UA.EDU
Date:   23/09/2020 14:54
Subject:[EXTERNAL] Re: SORT question: How to both remove records 
from a file AND write removed records to a 2nd output?
Sent by:IBM Mainframe Discussion List 



That might indeed be interesting if I knew what SUBSYS=PIPE was.  Is that 
the z/OS BatchPipes product?  If so I do not have that available here.

Peter

-Original Message-
From: IBM Mainframe Discussion List  On Behalf 
Of Martin Packer
Sent: Wednesday, September 23, 2020 4:31 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: SORT question: How to both remove records from a file AND 
write removed records to a 2nd output?

EXTERNAL EMAIL

OUTFIL SPLIT.

Something also from the mists of time, by no coincidence, is this: 
https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.icea100/ice2ca_Example_11._Sort_with_Pipes_and_OUTFIL_SPLIT.htm
 


TBH, I probably wrote that and Frank made it worth reading. :-)

Cheers, Martin

Martin Packer

Systems Investigator & Performance Troubleshooter, IBM

+44-7802-245-584

email: martin_pac...@uk.ibm.com

Twitter / Facebook IDs: MartinPacker

Blog: 
https://mainframeperformancetopics.com 


Mainframe, Performance, Topics Podcast Series (With Marna Walle): 
https://anchor.fm/marna-walle 


Youtube channel: 
https://www.youtube.com/channel/UCu_65HaYgksbF6Q8SQ4oOvA 




From:   Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
To: IBM-MAIN@LISTSERV.UA.EDU
Date:   22/09/2020 20:31
Subject:[EXTERNAL] Re: SORT question: How to both remove records 
from a file AND write removed records to a 2nd output?
Sent by:IBM Mainframe Discussion List 



On Tue, 22 Sep 2020 20:08:12 +0100, Martin Packer wrote:
>
>SAVE has, to my mind, been most invaluable. Prior to this you had to 
>figure out the boolean complement of the INCLUDE= clause. With more 
>than one INCLUDE= clause in a sort it became hairier, requiring De 
>Morgan's Law*. :-)  SAVE made this a lot simpler and less error prone.
> 
Yet adding a NOT operator to the grammar (no one has mentioned that there 
is one) would relieve programmers of the chore of rewriting complex 
Boolean expressions with De Morgan's Law.

>"Card Dealer" not so much.
> 
I don't know "Card Dealer".  Does that amount to having multiple OUTFILs 
using different tags?

Thanks,
gil

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




Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


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

This message and any attachments are intended only for the use of the 
addressee and may contain information that is privileged and confidential. 
If the reader of the message is not the intended recipient or an 
authorized representative of the intended recipient, you are hereby 
notified that any dissemination of this communication is strictly 
prohibited. If you have received this communication in error, please 
notify us immediately by e-mail and delete the message and any attachments 
from your system.

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




Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-23 Thread Farley, Peter x23353
That might indeed be interesting if I knew what SUBSYS=PIPE was.  Is that the 
z/OS BatchPipes product?  If so I do not have that available here.

Peter

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Martin Packer
Sent: Wednesday, September 23, 2020 4:31 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: SORT question: How to both remove records from a file AND write 
removed records to a 2nd output?

EXTERNAL EMAIL

OUTFIL SPLIT.

Something also from the mists of time, by no coincidence, is this: 
https://urldefense.com/v3/__https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.icea100/ice2ca_Example_11._Sort_with_Pipes_and_OUTFIL_SPLIT.htm__;!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!djsBTdtRWhlMDjqIDWZ3N2tii2HhPjYswgwHMqZah3Ae3uJs0JFjTuTVRzoFQonkEIOCWw$
 

TBH, I probably wrote that and Frank made it worth reading. :-)

Cheers, Martin

Martin Packer

Systems Investigator & Performance Troubleshooter, IBM

+44-7802-245-584

email: martin_pac...@uk.ibm.com

Twitter / Facebook IDs: MartinPacker

Blog: 
https://urldefense.com/v3/__https://mainframeperformancetopics.com__;!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!djsBTdtRWhlMDjqIDWZ3N2tii2HhPjYswgwHMqZah3Ae3uJs0JFjTuTVRzoFQokXweXXaQ$
 

Mainframe, Performance, Topics Podcast Series (With Marna Walle): 
https://urldefense.com/v3/__https://anchor.fm/marna-walle__;!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!djsBTdtRWhlMDjqIDWZ3N2tii2HhPjYswgwHMqZah3Ae3uJs0JFjTuTVRzoFQokxmRitYQ$
 

Youtube channel: 
https://urldefense.com/v3/__https://www.youtube.com/channel/UCu_65HaYgksbF6Q8SQ4oOvA__;!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!djsBTdtRWhlMDjqIDWZ3N2tii2HhPjYswgwHMqZah3Ae3uJs0JFjTuTVRzoFQonXW_nH9A$
 



From:   Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
To: IBM-MAIN@LISTSERV.UA.EDU
Date:   22/09/2020 20:31
Subject:[EXTERNAL] Re: SORT question: How to both remove records 
from a file AND write removed records to a 2nd output?
Sent by:IBM Mainframe Discussion List 



On Tue, 22 Sep 2020 20:08:12 +0100, Martin Packer wrote:
>
>SAVE has, to my mind, been most invaluable. Prior to this you had to 
>figure out the boolean complement of the INCLUDE= clause. With more 
>than one INCLUDE= clause in a sort it became hairier, requiring De 
>Morgan's Law*. :-)  SAVE made this a lot simpler and less error prone.
> 
Yet adding a NOT operator to the grammar (no one has mentioned that there is 
one) would relieve programmers of the chore of rewriting complex Boolean 
expressions with De Morgan's Law.

>"Card Dealer" not so much.
> 
I don't know "Card Dealer".  Does that amount to having multiple OUTFILs using 
different tags?

Thanks,
gil

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




Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


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

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-23 Thread Martin Packer
Sometimes "in a parallel universe" can mean "in this universe"... :-)

It would be poacher turned, ahem, poacher... :-)

Cheers, Martin

Martin Packer

Systems Investigator & Performance Troubleshooter, IBM

+44-7802-245-584

email: martin_pac...@uk.ibm.com

Twitter / Facebook IDs: MartinPacker

Blog: https://mainframeperformancetopics.com

Mainframe, Performance, Topics Podcast Series (With Marna Walle): 
https://anchor.fm/marna-walle

Youtube channel: https://www.youtube.com/channel/UCu_65HaYgksbF6Q8SQ4oOvA



From:   Sri h Kolusu 
To: IBM-MAIN@LISTSERV.UA.EDU
Date:   22/09/2020 20:34
Subject:[EXTERNAL] Re: SORT question: How to both remove records 
from a file AND write removed records to a 2nd output?
Sent by:IBM Mainframe Discussion List 



> On the "tagging" that Sri Hari mentioned:
>
> 1) You needn't tag unless you want to - and there will be some occasions
> where you don't want to.

Matrin,

Fully agreed.  I just wanted to show case with IFTHEN it is much easier to
split into multiple files with different conditions.

> Just some thoughts from someone who's loved playing with what DFSORT can
> do but has never actually been a DFSORT developer.


You are always welcome to join DFSORT.


Thanks,
Kolusu


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




Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-23 Thread Martin Packer
OUTFIL SPLIT.

Something also from the mists of time, by no coincidence, is this: 
https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.icea100/ice2ca_Example_11._Sort_with_Pipes_and_OUTFIL_SPLIT.htm

TBH, I probably wrote that and Frank made it worth reading. :-)

Cheers, Martin

Martin Packer

Systems Investigator & Performance Troubleshooter, IBM

+44-7802-245-584

email: martin_pac...@uk.ibm.com

Twitter / Facebook IDs: MartinPacker

Blog: https://mainframeperformancetopics.com

Mainframe, Performance, Topics Podcast Series (With Marna Walle): 
https://anchor.fm/marna-walle

Youtube channel: https://www.youtube.com/channel/UCu_65HaYgksbF6Q8SQ4oOvA



From:   Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
To: IBM-MAIN@LISTSERV.UA.EDU
Date:   22/09/2020 20:31
Subject:[EXTERNAL] Re: SORT question: How to both remove records 
from a file AND write removed records to a 2nd output?
Sent by:IBM Mainframe Discussion List 



On Tue, 22 Sep 2020 20:08:12 +0100, Martin Packer wrote:
>
>SAVE has, to my mind, been most invaluable. Prior to this you had to
>figure out the boolean complement of the INCLUDE= clause. With more than
>one INCLUDE= clause in a sort it became hairier, requiring De Morgan's
>Law*. :-)  SAVE made this a lot simpler and less error prone.
> 
Yet adding a NOT operator to the grammar (no one has mentioned that
there is one) would relieve programmers of the chore of rewriting complex
Boolean expressions with De Morgan's Law.

>"Card Dealer" not so much.
> 
I don't know "Card Dealer".  Does that amount to having multiple OUTFILs
using different tags?

Thanks,
gil

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




Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-22 Thread Sri h Kolusu
> On the "tagging" that Sri Hari mentioned:
>
> 1) You needn't tag unless you want to - and there will be some occasions
> where you don't want to.

Matrin,

Fully agreed.  I just wanted to show case with IFTHEN it is much easier to
split into multiple files with different conditions.

> Just some thoughts from someone who's loved playing with what DFSORT can
> do but has never actually been a DFSORT developer.


You are always welcome to join DFSORT.


Thanks,
Kolusu


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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-22 Thread Paul Gilmartin
On Tue, 22 Sep 2020 20:08:12 +0100, Martin Packer wrote:
>
>SAVE has, to my mind, been most invaluable. Prior to this you had to
>figure out the boolean complement of the INCLUDE= clause. With more than
>one INCLUDE= clause in a sort it became hairier, requiring De Morgan's
>Law*. :-)  SAVE made this a lot simpler and less error prone.
> 
Yet adding a NOT operator to the grammar (no one has mentioned that
there is one) would relieve programmers of the chore of rewriting complex
Boolean expressions with De Morgan's Law.

>"Card Dealer" not so much.
> 
I don't know "Card Dealer".  Does that amount to having multiple OUTFILs
using different tags?

Thanks,
gil

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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-22 Thread Martin Packer
Back in the mists of time - so I can say it now :-) - Frank Yaeger and I 
were discussing how we might add some things to the first offering of 
OUTFIL in DFSORT that weren't then in Syncsort. We came up with SAVE and 
"Card Dealer".

SAVE has, to my mind, been most invaluable. Prior to this you had to 
figure out the boolean complement of the INCLUDE= clause. With more than 
one INCLUDE= clause in a sort it became hairier, requiring De Morgan's 
Law*. :-)  SAVE made this a lot simpler and less error prone.

"Card Dealer" not so much.

I would expect both implementations - DFSORT and Syncsort - to have had 
these functions since the 1990s and both have gone much further.

On the "tagging" that Sri Hari mentioned:

1) You needn't tag unless you want to - and there will be some occasions 
where you don't want to. One example might be if you've been counting with 
SUM FIELDS= and a binary "ONE" field. You might throw away records where 
the count is less than, say, 100.

2) One other thing you might want to do is to throw away, say, 90% of the 
records on the way in with INCLUDE/OMIT and then divide up the surviving 
records on the way out, using OUTFIL INCLUDE=/OMIT= and SAVE.

Just some thoughts from someone who's loved playing with what DFSORT can 
do but has never actually been a DFSORT developer.

* Augustus De Morgan founded the Maths Department at UCL, where I learnt a 
trick or two. :-)

Cheers, Martin

Martin Packer

Systems Investigator & Performance Troubleshooter, IBM

+44-7802-245-584

email: martin_pac...@uk.ibm.com

Twitter / Facebook IDs: MartinPacker

Blog: https://mainframeperformancetopics.com

Mainframe, Performance, Topics Podcast Series (With Marna Walle): 
https://anchor.fm/marna-walle

Youtube channel: https://www.youtube.com/channel/UCu_65HaYgksbF6Q8SQ4oOvA



From:   Sri h Kolusu 
To: IBM-MAIN@LISTSERV.UA.EDU
Date:   22/09/2020 19:24
Subject:[EXTERNAL] Re: SORT question: How to both remove records 
from a file AND write removed records to a 2nd output?
Sent by:IBM Mainframe Discussion List 



> In one pass of an input file is there a way to use SORT to both
> remove identified records from an input file AND write those removed
> records to a second output file?


Peter,

You don't need 2 passes of data, you can tag the records that match your
identification and then use that tag to filter the records on OUTFIL. Some
thing like this

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC  - DROP THIS RECORD
DEF  - PICK THIS RECORD
EFG  - PICK THIS RECORD
XYZ  - DROP THIS RECORD
ZZZ  - DROP THIS RECORD
//PICKREC  DD SYSOUT=*
//DROPREC  DD SYSOUT=*
//SYSINDD *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,3,SS,EQ,C'DEF,EFG'),
   OVERLAY=(81:C'A'))

  OUTFIL FNAMES=PICKREC,
  INCLUDE=(81,1,CH,EQ,C'A'),
  BUILD=(1,80)

  OUTFIL FNAMES=DROPREC,SAVE,
  BUILD=(1,80)
/*


The PICKREC file will have the following records

DEF  - PICK THIS RECORD
EFG  - PICK THIS RECORD

The DROPREC file will have the following records

ABC  - DROP THIS RECORD
XYZ  - DROP THIS RECORD
ZZZ  - DROP THIS RECORD


For VB files, make sure that you have the Indicator right after the RDW so
that you retain the variable length records as is

Something like this

//SYSINDD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
 BUILD=(1,4,$ RDW
X,  $ ID TAG
5)),$ DATA AS-IS

IFTHEN=(WHEN=(6,3,SS,EQ,C'DEF,EFG'),
   OVERLAY=(05:C'A'))

  OUTFIL FNAMES=PICKREC,
  INCLUDE=(05,1,CH,EQ,C'A'),
BUILD=(1,04,$ RDW
   6)   $ DATA AS-IS

  OUTFIL FNAMES=DROPREC,SAVE,
BUILD=(1,04,$ RDW
   6)   $ DATA AS-IS
/*


Fruther if you have any questions please let me know

Thanks,
 Kolusu
DFSORT Development
IBM Corporation

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




Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-22 Thread Farley, Peter x23353
Thanks Sri, that is just what I need.

Peter

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of Sri 
h Kolusu
Sent: Tuesday, September 22, 2020 2:24 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: SORT question: How to both remove records from a file AND write 
removed records to a 2nd output?

> In one pass of an input file is there a way to use SORT to both remove 
> identified records from an input file AND write those removed records 
> to a second output file?


Peter,

You don't need 2 passes of data, you can tag the records that match your 
identification and then use that tag to filter the records on OUTFIL. Some 
thing like this

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC  - DROP THIS RECORD
DEF  - PICK THIS RECORD
EFG  - PICK THIS RECORD
XYZ  - DROP THIS RECORD
ZZZ  - DROP THIS RECORD
//PICKREC  DD SYSOUT=*
//DROPREC  DD SYSOUT=*
//SYSINDD *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,3,SS,EQ,C'DEF,EFG'),
   OVERLAY=(81:C'A'))

  OUTFIL FNAMES=PICKREC,
  INCLUDE=(81,1,CH,EQ,C'A'),
  BUILD=(1,80)

  OUTFIL FNAMES=DROPREC,SAVE,
  BUILD=(1,80)
/*


The PICKREC file will have the following records

DEF  - PICK THIS RECORD
EFG  - PICK THIS RECORD

The DROPREC file will have the following records

ABC  - DROP THIS RECORD
XYZ  - DROP THIS RECORD
ZZZ  - DROP THIS RECORD


For VB files, make sure that you have the Indicator right after the RDW so that 
you retain the variable length records as is

Something like this

//SYSINDD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
 BUILD=(1,4,$ RDW
X,  $ ID TAG
5)),$ DATA AS-IS

IFTHEN=(WHEN=(6,3,SS,EQ,C'DEF,EFG'),
   OVERLAY=(05:C'A'))

  OUTFIL FNAMES=PICKREC,
  INCLUDE=(05,1,CH,EQ,C'A'),
BUILD=(1,04,$ RDW
   6)   $ DATA AS-IS

  OUTFIL FNAMES=DROPREC,SAVE,
BUILD=(1,04,$ RDW
   6)   $ DATA AS-IS
/*

--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-22 Thread Sri h Kolusu
> In one pass of an input file is there a way to use SORT to both
> remove identified records from an input file AND write those removed
> records to a second output file?


Peter,

You don't need 2 passes of data, you can tag the records that match your
identification and then use that tag to filter the records on OUTFIL. Some
thing like this

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC  - DROP THIS RECORD
DEF  - PICK THIS RECORD
EFG  - PICK THIS RECORD
XYZ  - DROP THIS RECORD
ZZZ  - DROP THIS RECORD
//PICKREC  DD SYSOUT=*
//DROPREC  DD SYSOUT=*
//SYSINDD *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,3,SS,EQ,C'DEF,EFG'),
   OVERLAY=(81:C'A'))

  OUTFIL FNAMES=PICKREC,
  INCLUDE=(81,1,CH,EQ,C'A'),
  BUILD=(1,80)

  OUTFIL FNAMES=DROPREC,SAVE,
  BUILD=(1,80)
/*


The PICKREC file will have the following records

DEF  - PICK THIS RECORD
EFG  - PICK THIS RECORD

The DROPREC file will have the following records

ABC  - DROP THIS RECORD
XYZ  - DROP THIS RECORD
ZZZ  - DROP THIS RECORD


For VB files, make sure that you have the Indicator right after the RDW so
that you retain the variable length records as is

Something like this

//SYSINDD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
 BUILD=(1,4,$ RDW
X,  $ ID TAG
5)),$ DATA AS-IS

IFTHEN=(WHEN=(6,3,SS,EQ,C'DEF,EFG'),
   OVERLAY=(05:C'A'))

  OUTFIL FNAMES=PICKREC,
  INCLUDE=(05,1,CH,EQ,C'A'),
BUILD=(1,04,$ RDW
   6)   $ DATA AS-IS

  OUTFIL FNAMES=DROPREC,SAVE,
BUILD=(1,04,$ RDW
   6)   $ DATA AS-IS
/*


Fruther if you have any questions please let me know

Thanks,
 Kolusu
DFSORT Development
IBM Corporation

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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-22 Thread Farley, Peter x23353
Thanks Max, that would seem to be the way.

Peter

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Massimo Biancucci
Sent: Tuesday, September 22, 2020 1:44 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: SORT question: How to both remove records from a file AND write 
removed records to a 2nd output?

Peter,

look at OUTFIL syntax and SAVE keyword.

Regards.
Max

> In one pass of an input file is there a way to use SORT to both remove 
> identified records from an input file AND write those removed records 
> to a second output file?
>
> I know I can run two passes of the input using INCLUDE in pass 1 to 
> select just the records to be removed and a second pass using OMIT to 
> take them out, but can it be done in one pass?
>
> Peter
--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.


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


Re: SORT question: How to both remove records from a file AND write removed records to a 2nd output?

2020-09-22 Thread Massimo Biancucci
Peter,

look at OUTFIL syntax and SAVE keyword.

Regards.
Max


Mail
priva di virus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Il giorno mar 22 set 2020 alle ore 19:22 Farley, Peter x23353 <
031df298a9da-dmarc-requ...@listserv.ua.edu> ha scritto:

> In one pass of an input file is there a way to use SORT to both remove
> identified records from an input file AND write those removed records to a
> second output file?
>
> I know I can run two passes of the input using INCLUDE in pass 1 to select
> just the records to be removed and a second pass using OMIT to take them
> out, but can it be done in one pass?
>
> Peter
>
> This message and any attachments are intended only for the use of the
> addressee and may contain information that is privileged and confidential.
> If the reader of the message is not the intended recipient or an authorized
> representative of the intended recipient, you are hereby notified that any
> dissemination of this communication is strictly prohibited. If you have
> received this communication in error, please notify us immediately by
> e-mail and delete the message and any attachments from your system.
>
> --
> 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