View previous topic :: View next topic
|
Author |
Message |
John Howard
New User
Joined: 03 Aug 2007 Posts: 27 Location: Florida
|
|
|
|
I have a requirement to search a VB file and copy all records which contain a given string into a second file with no changes. All records are at least 80 bytes long and the search-for string (say c'ABCD') will be beyond byte 80. I have tried using INREC with PARSE, but can't figure out how to specify the BUILD parameter to include the entire record for the output file.
Thanks for your help. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Try this - it works for me
Code: |
OPTION VLSCMP
SORT FIELDS=COPY
INCLUDE COND=(85,lrecl-4,SS,EQ,C'your string') |
|
|
Back to top |
|
|
John Howard
New User
Joined: 03 Aug 2007 Posts: 27 Location: Florida
|
|
|
|
Getting a syntax message on the LRECL-4. I should have mentioned that I'm using Syncsort.
Sorry for the omission. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello John and welcome to the forum,
LRECL-4 is not a literal. . . |
|
Back to top |
|
|
John Howard
New User
Joined: 03 Aug 2007 Posts: 27 Location: Florida
|
|
|
|
So how can I tell what value to specify for record length if it is a VB?
Thanks again. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I've no way to try this, but you might see what max-lrecl - 4 does. . . |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Try this:
Code: |
//S1 EXEC PGM=SORT,PARM='VLTESTI=2'
//SORTIN DD DSN=input.data.set
//SORTOUT DD DSN=output.data.set
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(85,maxlrecl-84,SS,EQ,C'ABCD')
/*
|
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Sigh ............... when I specified LRECL in the control statement it was implied that the value should be taken from the DCB attributes of the file being read as input. |
|
Back to top |
|
|
John Howard
New User
Joined: 03 Aug 2007 Posts: 27 Location: Florida
|
|
|
|
This is what I get:
Code: |
SYSIN :
SORT FIELDS=COPY
INCLUDE COND=(85,MAXLRECL-84,SS,EQ,C'GREEN')
*
WER268A INCLUDE STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
1) Go to 3.4 or where ever
2) Find the LRECL of the dataset that is being used for input
3) Deduct 84 from the LRECL of the dataset
4) Substitute "MAXLRECL-84" in your control statement with the answer from line 3
5) Try the job again |
|
Back to top |
|
|
John Howard
New User
Joined: 03 Aug 2007 Posts: 27 Location: Florida
|
|
|
|
Ohhhhhhhhhhh. Sorry for being so dense.
But now I get:
Code: |
SYSIN :
SORT FIELDS=COPY
INCLUDE COND=(85,26536,SS,EQ,C'GREEN')
WER276B SYSDIAG= 753619, 1300841, 1300841, 9429136
WER164B 8,876K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 2,268K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=VB ; LRECL= 26620; BLKSIZE= 26624
WER110I SORTOUT : RECFM=VB ; LRECL= 26620; BLKSIZE= 26624
WER410B 7,848K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 2,120K BYTES USED
WER055I INSERT 0, DELETE 0
WER250A INCLUDE/OMIT FIELD BEYOND RECORD
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you may need to add OPTION VLSHRT or PARM='VLTESTI=2'
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
gcicchet wrote: |
Hi,
you may need to add OPTION VLSHRT or PARM='VLTESTI=2'
Gerry |
VLSHRT did not select any records using DFSORT, but VLSCMP did select the required records.
I know that there is a subtle difference between the two options. I guess that the VLSCMP equivilent will be required here, whatever that is. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Expat,
VLSCMP does not work for me with SYSNCSORT, VLSHRT works ok.
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Hi Gerry,
Probably a difference between products, but at least the OP should be happy now. |
|
Back to top |
|
|
John Howard
New User
Joined: 03 Aug 2007 Posts: 27 Location: Florida
|
|
|
|
I specified
Code: |
//JS0010 EXEC PGM=SORT,PARM=VLSHRT
|
Code: |
SYSIN :
SORT FIELDS=COPY
INCLUDE COND=(85,26534,SS,EQ,C'GREEN')
WER108I SORTIN : RECFM=VB ; LRECL= 26620; BLKSIZE= 26624
WER110I SORTOUT : RECFM=VB ; LRECL= 26620; BLKSIZE= 26624
WER055I INSERT 0, DELETE 25000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER054I RCD IN 25000, OUT 0
WER169I RELEASE 1.3 BATCH 0485 TPF LEVEL 1.0
WER052I END SYNCSORT - MDAJTH1A,JS0010,,DIAG=AA00,7186,82A2,00CE,E25E,4C8B,82E
|
[list]
No error, but no data. Yes,the character string "GREEN" is in the input file. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I guess that the next option would be to try Gerry's other option
|
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
John,
VLSHRT and VLSCMP are DFSORT OPTIONS. You are running SYNCSORT FOR Z/OS RELEASE 1.3. Therefore, specify PARM='VLTESTI=2' on the EXEC statement. If that still does not work, let me know and I will look into it further for you.
Regards, |
|
Back to top |
|
|
John Howard
New User
Joined: 03 Aug 2007 Posts: 27 Location: Florida
|
|
|
|
PARM='VLTESTI=2' worked.
Thanks Alissa. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Alissa,
are you sure VLSHRT is not a SYNCSORT option ?
I ran a job without VLSHRT and the following error message was generated.
Code: |
WER250A INCLUDE/OMIT FIELD BEYOND RECORD
|
I reran the job with VLSHRT and it ran fine.
Code: |
SYNCSORT FOR Z/OS 1.2.2.1N U.S. PATENTS: 4210961, 5117495 (C) 2005 SYNCSO
z/OS 1.7.1
SYSIN :
OPTION VLSHRT
SORT FIELDS=COPY
INCLUDE COND=(10,121,SS,EQ,C'HK')
WER276B SYSDIAG= 580898, 902494, 902494, 887729
WER164B 18,804K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 9,428K BYTES USED
WER146B 4K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=VBA ; LRECL= 135; BLKSIZE= 9076
WER110I SORTOUT : RECFM=VBA ; LRECL= 135; BLKSIZE= 9076
WER410B 15,728K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 9,092K BYTES USED
WER055I INSERT 0, DELETE 236524
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B SORTIN : EXCP'S=15,UNIT=3390,DEV=2D77,CHP=41464542,VOL=PR9143
WER416B BSAM WAS USED FOR SORTOUT
WER054I RCD IN 250426, OUT 13902
WER169I RELEASE 1.2 BATCH 0453 TPF LEVEL 2.1
|
Gerry |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Gerry,
I think Alissa was trying to say these are 'SyncSort compatible' DFSORT options. I remember having been able to use these options in SyncSort. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Yes, they are "SyncSort compatible" DFSORT OPTIONS, not SyncSort runtime PARMs. To clarify even further, they must be passed on the OPTION statement, not the PARM statement. |
|
Back to top |
|
|
|