Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to find a character say 'e' in a 2 fields of file
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 Moderator


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

PostPosted: Thu May 04, 2006 11:27 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri May 05, 2006 1:07 am    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Sat May 06, 2006 1:17 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us