Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


search a string

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
anu.slaksh
Member


Joined: 13 Nov 2007
Posts: 11

PostPosted: Sun May 18, 2008 1:31 pm    Post subject: search a string Reply with quote

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:

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..
Back to top
View user's profile Send private message

Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 487
Location: San Jose, CA

PostPosted: Sun May 18, 2008 9:32 pm    Post subject: Reply with quote

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:

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/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
anu.slaksh
Member


Joined: 13 Nov 2007
Posts: 11

PostPosted: Mon May 19, 2008 12:39 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 487
Location: San Jose, CA

PostPosted: Tue May 20, 2008 1:29 am    Post subject: Reply with quote

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:

//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/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Presence of mind......too good example !!! 3 Anuj Dhawan 1620 Thu Feb 04, 2010 5:26 am
basujanm2310 View latest post
No new posts In cics what is new copy.please give me a example. 2 mainframe5 4525 Fri Mar 06, 2009 1:13 pm
kapil agarwal View latest post
No new posts what is spanned records in vsam.please give me a example. 1 mainframe5 1447 Tue Nov 25, 2008 9:03 am
Anuj Dhawan View latest post
No new posts what is SPAM RECORDS IN VSAM please give me a example. 2 mainframe5 1664 Tue Nov 25, 2008 8:46 am
Anuj Dhawan View latest post
No new posts for debugging , i need to display variables in hexadecimal 6 danig 2433 Thu Apr 17, 2008 1:34 pm
danig View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB