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

condition for pattern string equal to fields beginning


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 Developer


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

PostPosted: Mon Mar 16, 2009 9:04 pm
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
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 Developer


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

PostPosted: Tue Mar 17, 2009 8:54 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Search string in job at regular Spool... CLIST & REXX 0
Search our Forums:

Back to Top