Page 1 of 1

Substring search on variable length record

PostPosted: Wed Jul 21, 2010 9:25 pm
by SnowBeagle
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.

Re: Substring search on variable length record

PostPosted: Wed Jul 21, 2010 10:36 pm
by Frank Yaeger
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

Re: Substring search on variable length record

PostPosted: Wed Jul 21, 2010 11:32 pm
by SnowBeagle
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.

Re: Substring search on variable length record

PostPosted: Wed Jul 21, 2010 11:44 pm
by Frank Yaeger
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.

Re: Substring search on variable length record

PostPosted: Wed Jul 21, 2010 11:59 pm
by SnowBeagle
Ah, excellent. Thank you again!