Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
condition for pattern string equal to fields beginning

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
cieron

New User


Joined: 04 Mar 2009
Posts: 5
Location: Warsaw

PostPosted: Mon Mar 16, 2009 6:56 pm    Post subject: condition for pattern string equal to fields beginning
Reply with quote

Hi
I have input file with words. For example:

WARSAW
PARIS
WASHINGTON
NEWYORK
BERLIN
MOSCOW
IOWA

I need to get words starting from pattern string. For example 'WA'
Output:
WARSAW
WASHINGTON

But problem is in unknow length of pattern string. Some process ganarates it. This pattern can look like 'WA' but can be also 'WAR'.

I tried use 'SS'
INCLUDE COND=(1,30,CH,SS,EQ,C'WA')
but it returns also words containing pattern string (IOWA).

Is it any way I can do it?
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 16, 2009 7:38 pm    Post subject:
Reply with quote

Input looks like a work on a line.
Then what is need to use substring?

Quote:
I need to get words starting from pattern string. For example 'WA'


Why can't you just use
INCLUDE COND=(1,2,CH,EQ,C'WA') ?
Back to top
View user's profile Send private message
cieron

New User


Joined: 04 Mar 2009
Posts: 5
Location: Warsaw

PostPosted: Mon Mar 16, 2009 7:54 pm    Post subject:
Reply with quote

I don't know exactly length of pattern string. Pettern is generated by other process.

It can be 'WA', so we can use:
INCLUDE COND=(1,2,CH,EQ,C'WA')

but it can be 'WAR', so we should use:
INCLUDE COND=(1,3,CH,EQ,C'WAR')

Maybe is there any special character which means any alfanumeric sign?
For example:
INCLUDE COND=(1,10,CH,EQ,C'WA????????')
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: Mon Mar 16, 2009 9:04 pm    Post subject:
Reply with quote

cieron,

Your need for a special character (wildcard) is not clear.

If you are looking for words that start with WA, you would use 1,2,CH,EQ,C'WA'. If you are looking for words that start with WAR, you would use 1,3,CH,EQ,C'WAR'. What would 1,10,CH,EQ,C'WA???????' do that 1,2,CH,EQ,C'WA' wouldn't do? 1,10,CH,EQ,C'WA????????' would get you WA* so it would include WAR* just like 1,2,CH,EQ,C'WA' would.

If you really can't use 1,2,CH,EQ,C'WA', then you need to explain more clearly in what situations it wouldn't work and how the wildcard would help.
Back to top
View user's profile Send private message
cieron

New User


Joined: 04 Mar 2009
Posts: 5
Location: Warsaw

PostPosted: Tue Mar 17, 2009 3:25 pm    Post subject:
Reply with quote

Ok, maybe I didn't explain clearly my situation.

I've got input dataset and I have specified symnames describing fields in this file.

Other process generates dataset with INCLUDE COND clause. This dataset comes to my sort from outside mainframe environment. People whose implementing this process are not familiar with mainframes. They do not want keep file record format description in their system, but they must prepare conditions. I'm helping them.

I want they prepare only "logical" conditions because record format is specified in symnames.
For example:
INCLUDE COND(BALANCE,GT,+1000,AND,CITY,SS,EQ,C'WA')

But they must have possibility to prepare condition: field is starting from pattern string (for example 'WA')
INCLUDE COND(CITY,EQ,C'WA********')

Maybe it is other way, thay can give me information about filter conditions?
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: Tue Mar 17, 2009 8:54 pm    Post subject:
Reply with quote

DFSORT does NOT have a wildcard capability like C'WA********'.

Are you saying that CITY will have a specific length (like 10) that you can't change, so you need to adapt the constant to that length? That doesn't seem like a good strategy. If they want to use 'WA' as the start of the constant, why can't they generate another symbol with a length of 2 that they can use in the INCLUDE statement:

Code:

CITY,1,10,CH
CITYCD,=,2,=


so they can use:

Code:

  INCLUDE COND=(CITYCD,EQ,C'WA')


At any rate, since I don't know the details of what these "people" are doing/expecting and what you are doing/expecting, I can't offer much help.

Quote:
Maybe it is other way, thay can give me information about filter conditions?


If you're asking a question here, I don't understand what you're asking.
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us