search a string - OMIT OVERLAY

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
anu.slaksh
Member
Posts: 11
Joined: Tue Nov 13, 2007 1:57 pm

search a string - OMIT OVERLAY

Post by anu.slaksh » Sun May 18, 2008 1:31 pm

Here is my requirement,

i have ps file with record length 42.
1-9 is employee id
10-42 is employee name..

in this file i need to search for a string 'JACK'. If this is present in any position from 10 - 42 this record has to be reported or else if 'JACK' is the only string found from 10 - 42 position that record has to be skipped.
for example.

Code: Select all

emp - id    emp-name
xxxxxxxxxJACK HENDRY
aaaaaaaaaHARRIS JACK
bbbbbbbbb     JACK
here, the third record has to be skipped as the string 'JACK' is not preceeded or followed by any other string.

Can this be done in sort??
if so can anyone tell the possible ways..

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Sun May 18, 2008 9:32 pm

By "skipped", do you mean deleted?
By "reported", do you mean included?

What do you want to do if JACK is NOT found anywhere in the field?

To make it clear what you want to do, show me the output records you would expect for the following input records.

Code: Select all

xxxxxxxxxJACK HENDRY
aaaaaaaaaHARRIS JACK
bbbbbbbbb     JACK
yyyyyyyyy HARRIS
ccccccccc   JOHN HARRIS
zzzzzzzzz  JACK JACK
qqqqqqqqq   JACKIE
rrrrrrrrr JACKIE CHAN
mmmmmmmmm  HIJACK
aaaaaaaaa  NO HIJACK
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

anu.slaksh
Member
Posts: 11
Joined: Tue Nov 13, 2007 1:57 pm

Post by anu.slaksh » Mon May 19, 2008 12:39 pm

as per my requirement,

the output should be:
xxxxxxxxxJACK HENDRY
aaaaaaaaaHARRIS JACK
yyyyyyyyy HARRIS
ccccccccc JOHN HARRIS
zzzzzzzzz JACK JACK
qqqqqqqqq JACKIE
rrrrrrrrr JACKIE CHAN
mmmmmmmmm HIJACK
aaaaaaaaa NO HIJACK

Hope this clears your query

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue May 20, 2008 1:29 am

So you just want to delete any records that only have 'JACK' and keep all the other records. You can use this DFSORT job:

Code: Select all

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/42)
//SORTOUT DD DSN=...  output file (FB/42)
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(43:10,33,JFY=(SHIFT=LEFT))
  OUTFIL OMIT=(43,33,CH,EQ,C'JACK'),BUILD=(1,42)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others