Substring search on variable length record



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Substring search on variable length record

Postby SnowBeagle » Wed Jul 21, 2010 9:25 pm

Good morning,

I'm attempting to find "TacoBell" within a variable length record using the substring function. Unfortunately, I receive "ICE218A 6 1082 BYTE VARIABLE RECORD IS SHORTER THAN 9999 BYTE MINIMUM FOR FIELDS" error message upon execution. How do I specify to check the entire length of each record without actually specifying a value (9995)?

RECORD TYPE=V, LENGTH=10000
INCLUDE FORMAT=SS,COND=(5,9995,EQ,C'TacoBell')


I've tried variations of the COND statement, but have yet to locate the answer. It has to be something simple that I'm overlooking!

As a side note, the value I wish to find can occur anywhere within the record.

Thank you,
Brian.
SnowBeagle
 
Posts: 3
Joined: Wed Jul 21, 2010 9:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Substring search on variable length record

Postby Frank Yaeger » Wed Jul 21, 2010 10:36 pm

Did you try looking up the ICE218A message? It tells you what to do:

http://publibz.boulder.ibm.com/cgi-bin/ ... SPTKC00195

If a variable-length record was too short to contain all INCLUDE or OMIT fields, use the VLSCMP or VLSHRT option to prevent DFSORT from terminating.


Add:

   OPTION VLSCMP
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Substring search on variable length record

Postby SnowBeagle » Wed Jul 21, 2010 11:32 pm

Thank you sir. No, I must admit that I didn't look up the error message, but instead googled for "DFSort variable record substring".

I do have a follow up question about the differences between VLSCMP and VLSHRT. From the descriptions below, wouldn't it be more effecient to use VLSHRT instead of VLSCMP when dealing with a record max of 10,000 and a minimum of 1,082? VLSHRT (if I understand this correctly) will just read until the end of line and when less than the maximum length, force itself ok and move on to the next line. But VLSCMP will pad all variable records with binary zeros so that each record is 10,000 in length. I wasn't sure if there might be something that I'm missing here since this is the first time I've used either of those options.

VLSCMP Specifies whether DFSORT pads short variable-length compare fields.
VLSHRT Specifies whether DFSORT continues processing if a short variable-length control field, compare field or summary field is found.


Thank you again for your assistance,
Brian.
SnowBeagle
 
Posts: 3
Joined: Wed Jul 21, 2010 9:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Substring search on variable length record

Postby Frank Yaeger » Wed Jul 21, 2010 11:44 pm

VLSCMP only temporarily pads the records with binary zeros - it doesn't actually change the length of the output records.

VLSHRT will NOT work in your case - since you have 5,9995, any record shorter than 9999 will be be omitted.

VLSHRT (if I understand this correctly) will just read until the end of line and when less than the maximum length, force itself ok and move on to the next line.


No, if VLSHRT finds a "short record", it ignores it so it will not find the string in that record even if it's there. VLSCMP will allow the string in a short record to be found.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Substring search on variable length record

Postby SnowBeagle » Wed Jul 21, 2010 11:59 pm

Ah, excellent. Thank you again!
SnowBeagle
 
Posts: 3
Joined: Wed Jul 21, 2010 9:08 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post