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

fuzzy compare


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Martylin

New User


Joined: 08 Mar 2016
Posts: 13
Location: Taiwan

PostPosted: Thu Mar 30, 2017 2:45 pm
Reply with quote

Is there any kind of function for fuzzy compare in JCL ?

for example: the dataset look like :
a0001 111111AAAA111111
a0002 111AAAA111111111
a0003 11111111111111111
a0004 111111111AAAA111

"AAAA" is the string that I want to search! but the position is not fixed
output will be 1,2,4 rows

thanks!
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Mar 30, 2017 3:39 pm
Reply with quote

JCL cannot even do unfuzzy compares, other tahn to check returncodes from (a) previous step(s).

You need to use SuperC.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Mar 30, 2017 3:50 pm
Reply with quote

NO!

JCL has no ability to analyze or alter data. Period. Full stop. End of story. The sole purpose of JCL is to specify the environment in which batch programs programs run.

Now, are there any programs to perform a "fuzzy" find as you describe? One problem is there are many definitions of a "fuzzy" find. The example in the extended query, for example, can easily be written into a program, but it is so limited I rather doubt anyone wrote such a program.

JCL like this will perform the task you propose.
Code:
//A       EXEC PGM=IKJEFT01
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  *
e 'your data set' data nonum
v
f * 999999 /aaa/ ALL
end


This JCL runs a program: IKJEFT01, the TSO terminal monitor program, to run a TSO command (another program) to find (another program) all occurrences of the aaa string in the data set.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 30, 2017 4:23 pm
Reply with quote

You probably mean your SORT product.

Code:
 INCLUDE COND=(startofwheretosearch,endofwheretosearch,SS,C'AAAA')
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Mar 30, 2017 5:29 pm
Reply with quote

Bill Woodger wrote:
You probably mean your SORT product.

Code:
 INCLUDE COND=(startofwheretosearch,endofwheretosearch,SS,C'AAAA')

Code:
 INCLUDE COND=(startofwheretosearch,endofwheretosearch,SS,EQ,C'AAAA')
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Mar 30, 2017 5:33 pm
Reply with quote

AFAIR the topic starters who are not able to understand the difference between JCL, and Utility Program, some time earlier they had been sent to the beginners forum, isn't it?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 30, 2017 6:16 pm
Reply with quote

sadly over the majority of mainframe related forums
anything that is not a user written program is considered JCL

no corrections, flaming, ... , .....
have had any influence in changing the belief
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Mar 30, 2017 8:46 pm
Reply with quote

enrico-sorichetti wrote:
sadly over the majority of mainframe related forums
anything that is not a user written program is considered JCL

no corrections, flaming, ... , .....
have had any influence in changing the belief

Hum-m-m...
And mainframe is just a huge iPhone, isn't it?
Back to top
View user's profile Send private message
Martylin

New User


Joined: 08 Mar 2016
Posts: 13
Location: Taiwan

PostPosted: Fri Mar 31, 2017 6:59 am
Reply with quote

thanks to everyone
the answer is no haha, so I made a PLI program GFUZZY to do fuzzy search!

JCL
Code:

//GFUZZY  EXEC PGM=GFUZZY                           
//SYSPRINT DD SYSOUT=*                             
//INPUTFI  DD DSN=DATA.L024A01.PS,DISP=SHR         
//OUTPUTO  DD DSN=DATA.L024A02.PS,DISP=OLD         
//CARDINI  DD *                                     
00024,10,AA12345678                                 
/*                                                 
//*  1-5  LL=5  INPUT FILE LENGTH                   
//*  6-7  LL=2  FUZZY STRING LENGTH (MAX 60)       
//*  ??   FUZZY STRING (MAX 60 CHAR)               



PLI like this:

Code:

GWK_IDX = INDEX(GWK_INPUTF,GWK_SRCH_STR);
                                         
IF GWK_IDX ^= 0 THEN                     
   WRITE FILE (OUTPUTO) FROM (GWK_INPUTF);
/* END IF */   
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Mar 31, 2017 3:48 pm
Reply with quote

Martylin wrote:
thanks to everyone
the answer is no haha, so I made a PLI program GFUZZY to do fuzzy search!

And no doubt this resulted in the client being charged for some hobbyist piece of crapware.

Don't you flipping know that IBM provides a program called ISRSUPC, more commonly knows as SuperC that does exactly what you want, and rather a lot more efficiently!

Stupid boy!
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Compare two files with a key and writ... SYNCSORT 3
No new posts Compare latest 2 rows of a table usin... DB2 1
No new posts How to compare two rows of same table DB2 11
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
Search our Forums:

Back to Top