View previous topic :: View next topic
|
Author |
Message |
Martylin
New User
Joined: 08 Mar 2016 Posts: 13 Location: Taiwan
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
JCL cannot even do unfuzzy compares, other tahn to check returncodes from (a) previous step(s).
You need to use SuperC. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You probably mean your SORT product.
Code: |
INCLUDE COND=(startofwheretosearch,endofwheretosearch,SS,C'AAAA') |
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2018 Location: USA
|
|
|
|
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 |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2018 Location: USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2018 Location: USA
|
|
|
|
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 |
|
|
Martylin
New User
Joined: 08 Mar 2016 Posts: 13 Location: Taiwan
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
|