For Programmers: Free Programming Magazines  


Home > Archive > Cobol > February 2006 > Re: Search for a string using SORT









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Search for a string using SORT
Howard Brazee

2006-02-08, 6:55 pm

On 7 Feb 2006 18:32:01 -0800, "mftips@gmail.com" <mftips@gmail.com>
wrote:

>To Search for a particular string within a file when the exact position
>of that string within a record is not known and to write that record in
>the Output file the following SORT card can be used.
>
>Example 1:
>SORT FIELDS=COPY
>INCLUDE COND= (1, 80, SS, EQ, C'FIND STRING')


This is not the best forum for a SORT question. If you are referring
to IBM's mainframe sort, you might want to e-mail Frank Yeager
yaeger@ibm-main.lst or join the IBM list server list:
ibm-main@bama.ua.edu, (which he subscribes to), or look at the
newsgroup that has a copy of that listserver (which he may or may not
catch) bit.listserv.ibm-main .

Or check
http://www-03.ibm.com/servers/stora...t/srtmainf.html

2006-02-09, 7:55 am

In article <m12ku1lkrkudaa1bbglofuqu9l357tb63f@4ax.com>,
Howard Brazee <howard@brazee.net> wrote:
>On 7 Feb 2006 18:32:01 -0800, "mftips@gmail.com" <mftips@gmail.com>
>wrote:
>
>
>This is not the best forum for a SORT question.


I did not read this as a question, Mr Brazee, I read it as a
suggestion/tip... and it was a new one to me, too. I've used batch SUPERC
jobs to do this in the past, eg:

//SEARCH EXEC PGM=ISRSUPC,
// PARM=(SRCHCMP,
// 'ANYC')
//NEWDD DD DSN=YOUR.DSN.HERE,
// DISP=SHR
//OUTDD DD SYSOUT=*
//SYSIN DD *
SRCHFOR 'SMITH'
CMPCOLM 1:200

.... but I was unaware that DFSORT could do this ('SS' as a format is
mentioned in the documentation here and there but appears to be missing
from
<http://publibz.boulder.ibm.com/cgi-...4143823#TBLBOZO>
and
<http://publibz.boulder.ibm.com/cgi-...124143823&CASE=>
... and to learn A New Thing can be pleasant.

E'en more interesting... I just ran a test against a VSAM KSDS, LRECL=350,
about 65,000 recs, searching for 'SMITH' in columns 1 - 200. ISRSUPC used
1538 I/O counts (whatever those measure) and 2.04 CPU sec, DFSORT (REL
14.0) used 202 I/O counts and 1.10 CPU sec.

DD

Howard Brazee

2006-02-09, 6:55 pm

On Thu, 9 Feb 2006 13:41:21 +0000 (UTC), docdwarf@panix.com () wrote:


>I did not read this as a question, Mr Brazee, I read it as a
>suggestion/tip... and it was a new one to me, too. I've used batch SUPERC
>jobs to do this in the past, eg:


Here's some compare JCL I've used that you might find interesting.

//TBEB EXEC PGM=IEFBR14
//SORTOUT DD DSN=UMS.D44201.TEMP,
// DISP=(MOD,DELETE),SPACE=(TRK,0)
//SORTSTEP EXEC PGM=SORT
//SORTIN DD DSN=,DISP=SHR
// DD DSN=UMS.D44201.LAMV.LOAN.MASTER,DISP=SHR
//*DFSPARM DD DSN=UMS.TEST.DATA(DYNALLOC),DISP=SHR
//*SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,82,,CONTIG)
//*SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,82,,CONTIG)
//*SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,82,,CONTIG)
//SORTOUT DD DSN=UMS.D44201.TEMP,
// UNIT=DEVEDISK,
// SPACE=(CYL,(75,15),RLSE),
// DCB=(RECFM=FB,LRECL=1200,BLKSIZE=12000),

// DISP=(NEW,CATLG,DELETE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(01,1010,A),
FORMAT=CH
SUM FIELDS=NONE ELIMINATE DUPLICATES
//SUPERC EXEC PGM=ISRSUPC, *
// PARM=(DELTAL,LINECMP,
// ' NOSEQ',
// '')
//NEWDD DD DSN=UMS.D44201.LLDJ.MSTRFILE,
// DISP=SHR
//OLDDD DD DSN=UMS.D44201.LAMV.LOAN.MASTER,
// DISP=SHR
//OUTDD DD SYSOUT=(*)
//SYSIN DD *
OFOCUS COLS 1101:1115
NFOCUS COLS 1101:1115
LSTCOLM 1101:1115
/*
//
CMPCOLM 30:60,75
HTTP://PUBLIBZ.BOULDER.IBM.COM/CGI-...ZU220/APPENDIX1

2006-02-09, 6:55 pm

In article <2fjmu1ldr7aomn0g69vjb6epqj49qp674h@4ax.com>,
Howard Brazee <howard@brazee.net> wrote:
>On Thu, 9 Feb 2006 13:41:21 +0000 (UTC), docdwarf@panix.com () wrote:
>
>
>
>Here's some compare JCL I've used that you might find interesting.


[snip]

>LSTCOLM 1101:1115


*Most* interesting... thanks much!

DD

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com