Outrec When match with spaces.



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Outrec When match with spaces.

Postby Squashman » Mon Aug 11, 2014 11:16 pm

Very new to Syncsort. I have only ever used it to just sort a file by a few fields. I am just piecing together code I have found on this forum and on the web. It is basically de-duping a file and adding a code depending on the region the record is in. But I want to make it match the whole field.

This code works just fine if I just match on the first 4 characters of the field without any spaces.
SORT FIELDS=(091,15,CH,A,171,20,CH,A)                           
SUM FIELDS=NONE                                                 
OUTREC IFTHEN=(WHEN=(171,4,CH,EQ,C'WEST'),OVERLAY=(740:C'1')), -
               IFTHEN=(WHEN=NONE,OVERLAY=(740:C'2'))

But if I want to match on 'WEST REGION' which has a space in it I get a syntax error on the outrec statement.
SORT FIELDS=(091,15,CH,A,171,20,CH,A)                                   
SUM FIELDS=NONE                                                         
OUTREC IFTHEN=(WHEN=(171,11,CH,EQ,C'WEST REGION'),OVERLAY=(740:C'1')), -
               IFTHEN=(WHEN=NONE,OVERLAY=(740:C'2'))


What do I need to do to make it match the whole field regardless of spaces in it?
Squashman
 
Posts: 8
Joined: Mon Aug 11, 2014 10:57 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Outrec When match with spaces.

Postby BillyBoyo » Mon Aug 11, 2014 11:36 pm

Can you show the sysout of the step producing the error.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Outrec When match with spaces.

Postby BillyBoyo » Mon Aug 11, 2014 11:39 pm

Just to note, that "-" at the end is doing nothing for you. Anything after a space at the end of a statement (so spaces in literals are OK) is a comment. The continuation is being caused by the final comma, not by the "-".
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Outrec When match with spaces.

Postby Squashman » Mon Aug 11, 2014 11:43 pm

SYNCSORT FOR Z/OS  1.4.1.0R    U.S. PATENTS: 4210961, 5117495   (C) 2010 SYNCSORT INC.   DATE=2014/223   TIME=13.11.15
                                   ABC MARKETING SERVICES   z/OS   1.13.0                                   
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 07B0D, MODEL 2818 J03             LICENSE/PRODUCT EXPIRATION DATE: 01 NOV 2016
SYSIN :                                                                                                               
  SORT FIELDS=(091,15,CH,A,171,20,CH,A)                                                                               
  SUM FIELDS=NONE                                                                                                     
  OUTREC IFTHEN=(WHEN=(171,11,CH,EQ,C'WEST REGION'),OVERLAY=(740:C'1')), -                                           
                 IFTHEN=(WHEN=NONE,OVERLAY=(740:C'2'))                                                               
                 *                                                                                                   
WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                                                             
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                                                         
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                                                         
Squashman
 
Posts: 8
Joined: Mon Aug 11, 2014 10:57 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Outrec When match with spaces.

Postby Squashman » Mon Aug 11, 2014 11:47 pm

BillyBoyo wrote:Just to note, that "-" at the end is doing nothing for you. Anything after a space at the end of a statement (so spaces in literals are OK) is a comment. The continuation is being caused by the final comma, not by the "-".

I used the hyphen because that is the code I found on this site but that is good to know. I am used to just being able to continue lines in SAS without a continuation because the ; terminates the command. I have learned so many scripting languages over the years it is hard to know when you do and don't need a continuation. Everyone of them has their own syntax.
Squashman
 
Posts: 8
Joined: Mon Aug 11, 2014 10:57 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Outrec When match with spaces.

Postby Squashman » Tue Aug 12, 2014 12:49 am

Well this just seem completely hokey but it works. Really bothers me that it doesn't work a space.
SORT FIELDS=(091,15,CH,A,171,20,CH,A)                             
SUM FIELDS=NONE                                                   
OUTREC IFTHEN=(WHEN=(171,4,CH,EQ,C'WEST',&,176,6,CH,EQ,C'REGION'),
               OVERLAY=(740:C'1')),                               
               IFTHEN=(WHEN=NONE,OVERLAY=(740:C'2'))             
Squashman
 
Posts: 8
Joined: Mon Aug 11, 2014 10:57 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Outrec When match with spaces.

Postby BillyBoyo » Tue Aug 12, 2014 1:57 am

Try taking out, from your original, what looks to be a blank line.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Outrec When match with spaces.

Postby Squashman » Tue Aug 12, 2014 2:07 am

BillyBoyo wrote:Try taking out, from your original, what looks to be a blank line.

I don't have any blank lines in my code.
Squashman
 
Posts: 8
Joined: Mon Aug 11, 2014 10:57 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Outrec When match with spaces.

Postby BillyBoyo » Tue Aug 12, 2014 2:50 am

OK, it's a side-effect of the length of the line in the Code tags.

Can you try taking off the "-". It shouldn't make any difference, but something is stopping it working. It is curious. It should work.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Outrec When match with spaces.

Postby BillyBoyo » Tue Aug 12, 2014 3:01 am

I think your line is too long. You have run into the continuation-column, and it has either caused the comma to go missing or allowed a "gap" to appear in the code (depending on exactly what is in the continuation column (I think it is the comma, but difficult to be sure).

Chop the line up, at a comma, and all should be OK.

Other than that unfortunate thing, it was pretty well put together.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post