Page 1 of 1

String Search with RECFM=VB dataset

PostPosted: Fri Jun 05, 2009 9:45 pm
by tuffsubject
I have a need to search for a string in a sequential dataset that is RECFM=VB.

This is an example INCLUDE statement:
INCLUDE COND=(1,260,SS,EQ,C'BILL')

The problem is that any records within the file that are shorter than the length specified (260 in the case above), Syncsort simply drops/ignores the entire short record, even if it contains the search string. The result is that the "short" record is missing from the output.

Without utilizing an exit, how can I manipulate the sort control statements so that "short" records will also be processed?

Note: DFSORT pads the short records with x'00' by using OPTION VLSHRT,VLSCMP with the execution, and successfully processes the short records and finds the string. Is there an identical option with Syncsort?

Re: String Search with RECFM=VB dataset

PostPosted: Fri Jun 05, 2009 11:26 pm
by Alissa Margulies
Try adding the following PARM to the EXEC statement:
//S1 EXEC PGM=SORT,PARM='VLTESTI=2'

Re: String Search with RECFM=VB dataset

PostPosted: Sat Jun 06, 2009 2:27 am
by tuffsubject
Thank you for the suggestion. Unfortunately I have already tried the VLTESTI options.

From my experience:
VLTESTI=0 causes SyncSort to fail (terminate) if a short record is encountered
VLTESTI=1 results in the short record being treated "as having failed the comparison" (and, essentially drops the record when using the INCLUDE statement)
VLTESTI=2 essentially results in the same as VLTESTI=1 in this case, since my INCLUDE statement spans the entire LRECL. The records are dropped.

Question: Would VLTEST=0 solve the problem? I'm reading the doc, it appears that the default is VLTEST=1, but VLTEST=0 (I think) results in short records being padded with x'00'. That would be EXACTLY what I want, so long as VLTESTI checking sees the padded x'00' as being "real" data.

(I'm currently not on site to perform the test myself -- I'll test as soon as I can but asking this here in case someone on the forum has experience with this).

Re: String Search with RECFM=VB dataset

PostPosted: Tue Jun 09, 2009 8:56 pm
by tuffsubject
Alissa, thank you for replying. While I *thought* I had already tried VLTESTI=2, it turns out that I really had not. I was (incorrectly) specifying the VLTESTI=2 option in the SYSIN DD statement, just prior to the SORT and INCLUDE control statements. I moved the VLTESTI option statement to the $ORTPARM DD statement and that solved the problem! (I'm invoking ICEMAN from a REXX program, so I utilized the $ORTPARM DD instead of passing an execution parm to the program).

Another factor that kept me motivated to keep trying to find the resolution was a post made on the IBM-MAIN listserv from a SyncSort support staff member, indicating that the VLTESTI=2 option is "smart enough" to keep records when the string is found within a short record. So I knew I must have been doing something incorrectly.

Thanks again!

Re: String Search with RECFM=VB dataset

PostPosted: Tue Jun 09, 2009 8:59 pm
by Alissa Margulies
Thanks for the update. Glad you were able to correctly specify the VLTESTI option and get your application to produce the desired output.