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?
String Search with RECFM=VB dataset
-
- Posts: 3
- Joined: Fri Jun 05, 2009 9:24 pm
- Skillset: CA-Top Secret, REXX, JCL, TSO, ISPF, DFSORT, SYNCSORT, SAS, COBOL, Assembler
- Referer: Google
-
- Global moderator
- Posts: 369
- Joined: Tue Feb 26, 2008 11:15 pm
- Skillset: Syncsort MFX for z/OS
- Referer: Dick Scherrer
- Location: USA
- Contact:
Re: String Search with RECFM=VB dataset
Try adding the following PARM to the EXEC statement:
Code: Select all
//S1 EXEC PGM=SORT,PARM='VLTESTI=2'
-
- Posts: 3
- Joined: Fri Jun 05, 2009 9:24 pm
- Skillset: CA-Top Secret, REXX, JCL, TSO, ISPF, DFSORT, SYNCSORT, SAS, COBOL, Assembler
- Referer: Google
Re: String Search with RECFM=VB dataset
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).
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).
-
- Posts: 3
- Joined: Fri Jun 05, 2009 9:24 pm
- Skillset: CA-Top Secret, REXX, JCL, TSO, ISPF, DFSORT, SYNCSORT, SAS, COBOL, Assembler
- Referer: Google
Re: String Search with RECFM=VB dataset
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!
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!
-
- Global moderator
- Posts: 369
- Joined: Tue Feb 26, 2008 11:15 pm
- Skillset: Syncsort MFX for z/OS
- Referer: Dick Scherrer
- Location: USA
- Contact:
Re: String Search with RECFM=VB dataset
Thanks for the update. Glad you were able to correctly specify the VLTESTI option and get your application to produce the desired output.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Replace a string with another string with different length
by Devrana » Sun Jan 19, 2025 3:23 pm » in JCL - 1
- 1653
-
by sergeyken
View the latest post
Sun Jan 19, 2025 11:07 pm
-
-
-
Add a string depending on pattern
by Prasanna G » Mon Jul 05, 2021 8:48 am » in DFSORT/ICETOOL/ICEGENER - 1
- 1348
-
by Prasanna G
View the latest post
Mon Jul 05, 2021 11:07 am
-
-
- 1
- 2999
-
by oliver07
View the latest post
Sat Oct 30, 2021 2:32 pm
-
- 2
- 8431
-
by prino
View the latest post
Sat Mar 13, 2021 4:47 am
-
- 4
- 2258
-
by sergeyken
View the latest post
Mon Jun 26, 2023 12:56 am