changing a record before the sort



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

changing a record before the sort

Postby migusd » Wed Oct 22, 2014 11:49 pm

Hi,
I have some garbage in some of the records that I would like to change.
But because it is a very large file, would like to select first the records I want to replace
So, I am assuming I can use only one IFTHEN-WHEN with several FINDREP.
but I am stuck with the IFTHEN. Got an ugly wer268.
here is the code
  INREC IFTHEN=(WHEN=(51,8,CH,EQ,C'ACTUALX3',OR,51,6,CH,EQ,C'VXY033'), 
                                                                                                                  *
        FINDREP=(ABSPOS=8,INOUT=(X'0T',X'40')),                       
        FINDREP=(ABSPOS=9,INOUT=(X'0T',X'40')),                       
        FINDREP=(ABSPOS=10,INOUT=(X'0T',X'40')),                       
        FINDREP=(ABSPOS=16,INOUT=(X'0T',X'40')))                       
   SORT FIELDS=(51,50,CH,A,1,50,CH,A)                                 
   SUM FIELDS=(102,8,ZD)                                               
   END


So, I changed it a bit like this one:
  INREC IFTHEN=(WHEN=(51,8,CH,EQ,C'ACTUALX3'),                     
                FINDREP=(IN,X'0D',OUT=X'40') STARTPOS=8,ENDPOS=16,
        IFTHEN=(WHEN=(51,6,CH,EQ,C'VXY033'),                       
                FINDREP=(IN,X'0D',OUT=X'40') STARTPOS=8,ENDPOS=16 
   SORT FIELDS=(51,50,CH,A,1,50,CH,A)                             
   SUM FIELDS=(102,8,ZD)                                           
   END 


...Still the same.
What am I missing ? don't get why it is complaing about the last comma at the end of the INREC line.

Thank

Miguel


I need to change a x'0T' to a space before the sort happens.

Code'd
migusd
 
Posts: 40
Joined: Tue Dec 01, 2009 9:26 pm
Has thanked: 6 times
Been thanked: 0 time

Re: changing a record before the sort

Postby migusd » Thu Oct 23, 2014 1:04 am

Thank you guys,
at least is running now.

still don't know why it was wrong the INREC, but it is running now
migusd
 
Posts: 40
Joined: Tue Dec 01, 2009 9:26 pm
Has thanked: 6 times
Been thanked: 0 time

Re: changing a record before the sort

Postby BillyBoyo » Thu Oct 23, 2014 1:50 am

X'0T' does not exist. Only 0-9 and A-F are valid hex digits.

You can only have one FINDREP per IFTHEN.

FINDREP runs within limits you provide, so maybe you'd not need multiples.

You need to fix up these, then post the full sysout including the message number and text and watch that the location of the "*" is correct, as that shows at what point an error was identified.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: changing a record before the sort

Postby migusd » Thu Oct 23, 2014 2:22 am

Thanks Billy,
I made a few errors, but still don't know what is wrong with this:

SYSIN :
INREC IFTHEN=(WHEN=(51,6,CH,EQ,C'VX033'),
*
FINDREP=(IN,X'0A',OUT=X'40'),STARTPOS=8,ENDPOS=16),
IFTHEN=(WHEN=(51,8,CH,EQ,C'ACTUALX3'),
FINDREP=(IN,X'0A',OUT=X'40'),STARTPOS=8,ENDPOS=16)
SORT FIELDS=(51,50,CH,A,1,50,CH,A)
SUM FIELDS=(102,8,ZD)
END
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Actually, the * is below the comma after VX033')
Couldn't figure out what was wrong, so I change it to this one instead, and worked fine:
SYSIN :
INREC IFTHEN=(WHEN=(51,5,CH,EQ,C'VX063',OR,51,8,CH,EQ,C'ACTUALX3'),
FINDREP=(INOUT=(X'0A',X'40'),
STARTPOS=8,ENDPOS=16))
SORT FIELDS=(51,50,CH,A,1,50,CH,A)
SUM FIELDS=(102,8,ZD)
END

Still would like to know what is wrong what I missed :)
the x'0t' is my mistake, I was switching back and fore with Character & Hex, so I posted the wrong value. But that is not the issue.

Thanks Billy
migusd
 
Posts: 40
Joined: Tue Dec 01, 2009 9:26 pm
Has thanked: 6 times
Been thanked: 0 time

Re: changing a record before the sort

Postby Terry Heinze » Thu Oct 23, 2014 2:34 am

migusd,
Please learn to use Code tags for readability.
.... Terry
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: changing a record before the sort

Postby migusd » Thu Oct 23, 2014 2:37 am

I will, Terry...
looking for Code tags... somewhere in here....:)

Thanks
migusd
 
Posts: 40
Joined: Tue Dec 01, 2009 9:26 pm
Has thanked: 6 times
Been thanked: 0 time

Re: changing a record before the sort

Postby Terry Heinze » Thu Oct 23, 2014 2:51 am

Use POSTREPLY instead of Quick Reply, click Code, insert (paste) your code between the two tags that show up, click Preview to see what it will look like, click Submit when satisfied.
.... Terry

These users thanked the author Terry Heinze for the post:
migusd (Thu Oct 23, 2014 3:05 am)
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: changing a record before the sort

Postby migusd » Thu Oct 23, 2014 3:05 am

Ok... thanks Terry.
version with error...

 SYSIN :                                                             
   INREC IFTHEN=(WHEN=(51,5,CH,EQ,C'VX033'),                         
                                           *                         
                 FINDREP=(IN,X'0A',OUT=X'40'),STARTPOS=8,ENDPOS=16)),
         IFTHEN=(WHEN=(51,8,CH,EQ,C'ACTUALX3'),                       
                 FINDREP=(IN,X'0A',OUT=X'40'),STARTPOS=8,ENDPOS=16)   
    SORT FIELDS=(51,50,CH,A,1,50,CH,A)                               
    SUM FIELDS=(102,8,ZD)                                             
    END                                                               
 WER268A  INREC STATEMENT   : SYNTAX ERROR                           
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                       


and ... I believe that I now see the issue.
I used 'in,' when I should have used 'in=' in the following line....

Thank you guys

Miguel
and this is the one that worked.

  SYSIN :                                                             
    INREC IFTHEN=(WHEN=(51,5,CH,EQ,C'VX033',OR,51,8,CH,EQ,C'ACTUALX3'),
                  FINDREP=(INOUT=(X'0A',X'40'),                       
                  STARTPOS=8,ENDPOS=16))                               
     SORT FIELDS=(51,50,CH,A,1,50,CH,A)                               
     SUM FIELDS=(102,8,ZD)                                             
     END                                                               
migusd
 
Posts: 40
Joined: Tue Dec 01, 2009 9:26 pm
Has thanked: 6 times
Been thanked: 0 time

Re: changing a record before the sort

Postby BillyBoyo » Thu Oct 23, 2014 4:13 am

Good spot. Often it is good to take a break, do something else. Then you see it when you start back. At times you have to go as far as forgetting everything you think you know about the problem before you can find out something you had assumed, and kept looking at, was actually different.

SORT is not designed to be the most helpful of language processors. That "*" sometimes means "I was OK up to that point, then lost the plot", so looking at the next line(s) can be useful. Now you know, it'll be easier next time.

I was going to suggest using INOUT. but you got there anyway.

The only remaining comment is to question the C'VX033'. If it is followed by three spaces, I code them. Saves a potential false hit sometime in the future. If you code it, the next along doesn't query it. If it is for matching leading characters of multiple values. include a comment.

If you want to look to take your SORT-writing further, consider how to use SORT symbols/SYMNAMES at some point.

These users thanked the author BillyBoyo for the post:
migusd (Thu Oct 23, 2014 8:48 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: changing a record before the sort

Postby migusd » Thu Oct 23, 2014 8:50 pm

Thanks Billy,
interesting stuff about SYMNAME and the dictionary feature... will work on that...
... :) I have to work on other parts as well. I haven't really tried the PARSE... or the BUILD you mentioned in one of my previous posts.

Thanks for your suggestions and tips

Miguel
migusd
 
Posts: 40
Joined: Tue Dec 01, 2009 9:26 pm
Has thanked: 6 times
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post