IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to find a character say 'e' in a 2 fields of file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VENQUET

New User


Joined: 04 May 2006
Posts: 8

PostPosted: Thu May 04, 2006 9:59 pm
Reply with quote

Hi,
Assume that i have 5 fields in the file.(say name1,name2,address,telpehone,account).
i want to find whether 'e' character is present in the two fields i.e Name1,name2.
NAME1 is of 35 character.
NAME2 is of 15 character.

'e' can be at first or sec or third .. soon on till 35 postions of Name1 field.
if it is present i need the record in different output file

This I want to do it by sort or icetool.

Plse help me out.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu May 04, 2006 11:27 pm
Reply with quote

You can use a DFSORT job like this if you want the records that have an 'e' in either field in the output file:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INCLUDE FORMAT=SS,
    COND=(1,35,EQ,C'e',OR,36,15,EQ,C'e')
/*


You can use a DFSORT job like this if you want the records that have an 'e' in both fields in the output file:

Code:

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INCLUDE FORMAT=SS,
    COND=(1,35,EQ,C'e',AND,36,15,EQ,C'e')
/*
Back to top
View user's profile Send private message
VENQUET

New User


Joined: 04 May 2006
Posts: 8

PostPosted: Fri May 05, 2006 12:55 am
Reply with quote

In my output file i am not getting any record which matches.
my dataset is empty
i am using sort for this.

plse clear my why i am getting no records in the file.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri May 05, 2006 1:07 am
Reply with quote

Well, let me gaze into my crystal ball and look at your actual input records. Wait, my crystal ball isn't working today. icon_rolleyes.gif

If you're not getting any records that match than you don't have an 'e' in the field or you changed something in the control statements or you don't have the correct positions for the fields or ...? Perhaps you're mismatching an uppercase E with a lowercase e? Perhaps you have VB records and you didn't account for the RDW in positions 1-4 (the first data byte starts in position 5). Perhaps ...

As a start, show us the control statements you actually used and the //SYSOUT messages.
Back to top
View user's profile Send private message
VENQUET

New User


Joined: 04 May 2006
Posts: 8

PostPosted: Sat May 06, 2006 12:48 am
Reply with quote

Hi Frank,
this is syntax i am using
COND=((98,1,EQ,C'1'),AND,(37,35,EQ,C'e',OR,72,35,EQ,C'e'))

i am getting maxcc =0.
but in the output file it is empty
Back to top
View user's profile Send private message
VENQUET

New User


Joined: 04 May 2006
Posts: 8

PostPosted: Sat May 06, 2006 1:02 am
Reply with quote

hi frank,

thanks for ur help

finally i got it.

thanks a lot
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat May 06, 2006 1:17 am
Reply with quote

I assume you actually have:

Code:

  INCLUDE FORMAT=SS,
      COND=((98,1,EQ,C'1'),AND,(37,35,EQ,C'e',OR,72,35,EQ,C'e'))


That tells DFSORT to only include the record if there's a '1' in position 98, AND an 'e' anywhere in 37,35 OR 72,35. If the output file is empty, then none of the records meet those criteria. BTW, you should really use CH for the first condition rather than SS - that will be more efficient but it won't change the outcome:

Code:

  INCLUDE FORMAT=SS,
      COND=((98,1,CH,EQ,C'1'),AND,(37,35,EQ,C'e',OR,72,35,EQ,C'e'))


If you want to see what's in the 37,35 and 72,35 fields for records with a '1' in 98, use these DFSORT control statements:

Code:

   OPTION COPY
   INCLUDE COND=(98,1,CH,EQ,C'1')
   OUTREC FIELDS=(C'<',37,35,C'<>',72,35,C'>')


I'm guessing you won't see any 'e's in there. If you do, then something else is wrong.

You didn't show me the //SYSOUT messages as I asked, so I can't tell if your input is VB or what else might be wrong.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top