Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - Search for string and copy whole record
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Search for string and copy whole record
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: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 04, 2009 7:17 pm    Post subject:
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    Post subject: Reply to: Search for string and copy whole record
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

Site Director


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

PostPosted: Tue Aug 04, 2009 8:24 pm    Post subject:
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    Post subject: Reply to: Syncsort - Search for string and copy whole record
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

Site Director


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

PostPosted: Tue Aug 04, 2009 9:36 pm    Post subject:
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: 500
Location: USA

PostPosted: Tue Aug 04, 2009 11:23 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 05, 2009 11:20 am    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 05, 2009 5:27 pm    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Aug 05, 2009 5:45 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 05, 2009 5:52 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Aug 05, 2009 6:12 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 05, 2009 6:18 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 05, 2009 7:43 pm    Post subject:
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: 500
Location: USA

PostPosted: Wed Aug 05, 2009 8:42 pm    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Aug 06, 2009 4:00 am    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us