IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - Search for string and copy whole record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
John Howard

New User


Joined: 03 Aug 2007
Posts: 27
Location: Florida

PostPosted: Tue Aug 04, 2009 5:55 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Aug 04, 2009 7:17 pm
Reply with quote

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
View user's profile Send private message
John Howard

New User


Joined: 03 Aug 2007
Posts: 27
Location: Florida

PostPosted: Tue Aug 04, 2009 8:12 pm
Reply with quote

Getting a syntax message on the LRECL-4. I should have mentioned that I'm using Syncsort.

Sorry for the omission.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Aug 04, 2009 8:24 pm
Reply with quote

Hello John and welcome to the forum,

LRECL-4 is not a literal. . .
Back to top
View user's profile Send private message
John Howard

New User


Joined: 03 Aug 2007
Posts: 27
Location: Florida

PostPosted: Tue Aug 04, 2009 8:38 pm
Reply with quote

So how can I tell what value to specify for record length if it is a VB?

Thanks again.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Aug 04, 2009 9:36 pm
Reply with quote

Hello,

I've no way to try this, but you might see what max-lrecl - 4 does. . .
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Aug 04, 2009 11:23 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 05, 2009 11:20 am
Reply with quote

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
View user's profile Send private message
John Howard

New User


Joined: 03 Aug 2007
Posts: 27
Location: Florida

PostPosted: Wed Aug 05, 2009 5:12 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 05, 2009 5:27 pm
Reply with quote

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
View user's profile Send private message
John Howard

New User


Joined: 03 Aug 2007
Posts: 27
Location: Florida

PostPosted: Wed Aug 05, 2009 5:41 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Aug 05, 2009 5:45 pm
Reply with quote

Hi,

you may need to add OPTION VLSHRT or PARM='VLTESTI=2'



Gerry
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 05, 2009 5:52 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Aug 05, 2009 6:12 pm
Reply with quote

Hi Expat,

VLSCMP does not work for me with SYSNCSORT, VLSHRT works ok.


Gerry
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 05, 2009 6:18 pm
Reply with quote

Hi Gerry,

Probably a difference between products, but at least the OP should be happy now.
Back to top
View user's profile Send private message
John Howard

New User


Joined: 03 Aug 2007
Posts: 27
Location: Florida

PostPosted: Wed Aug 05, 2009 7:37 pm
Reply with quote

I specified
Code:

//JS0010   EXEC PGM=SORT,PARM=VLSHRT   

    and got:

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 05, 2009 7:43 pm
Reply with quote

I guess that the next option would be to try Gerry's other option
Code:

PARM='VLTESTI=2'
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Aug 05, 2009 8:42 pm
Reply with quote

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
View user's profile Send private message
John Howard

New User


Joined: 03 Aug 2007
Posts: 27
Location: Florida

PostPosted: Wed Aug 05, 2009 11:50 pm
Reply with quote

PARM='VLTESTI=2' worked.

Thanks Alissa.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Aug 06, 2009 4:00 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Aug 06, 2009 4:11 am
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Aug 06, 2009 7:50 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
Search our Forums:

Back to Top