MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Syncsort - how to convert to negative number

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Feb 28, 2014 6:39 am    Post subject: Syncsort - how to convert to negative number Reply with quote

Hi,

I am trying to convert few numbers to negative if input number is greater than 500 but job abend with S0C7 !

Code:

//SORT0001 EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                         
//SORTOUT  DD SYSOUT=*                         
//SORTIN   DD *                               
10500                                         
205                                           
035                                           
1407                                           
//SYSIN    DD *                               
  SORT FIELDS=COPY                             
  INREC IFTHEN=(WHEN=(1,5,UFF,GT,500),         
    OVERLAY=(1:1,5,ZD,MUL,-1,TO=ZDC,LENGTH=6))


Can you please let me know where I am going wrong?

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Feb 28, 2014 8:20 am    Post subject: Syncsort - converting to negative numbers Reply with quote

Hi,

Our shop uses "SYNCSORT FOR Z/OS 1.3.2.2R" and I have made these attempts after searching this forum but don't get satisfactory results.

Attempt-1:
Code:

//SYSIN    DD *                                     
  SORT FIELDS=(1,5,UFF,A)                           
  INREC OVERLAY=(1:1,5,UFF,LENGTH=6)               
  OUTREC BUILD=(1:1,5,ZD,MUL,-1,TO=ZD,LENGTH=6)
  INCLUDE COND=(1,6,UFF,GT,+800)                   


Output:
Code:

00140P
01050}


Attempt-2:
Code:

//SYSIN    DD *                                     
  SORT FIELDS=(1,5,UFF,A)                           
  INREC OVERLAY=(1:1,5,UFF,LENGTH=6)               
  OUTREC BUILD=(1:1,5,ZD,MUL,-1,TO=ZD,EDIT=(STTTTT))
  INCLUDE COND=(1,6,UFF,GT,+800)                   


SYSOUT:
Code:

SYSIN :                                             
  SORT FIELDS=(1,5,UFF,A)                           
  INREC OVERLAY=(1:1,5,UFF,LENGTH=6)               
  OUTREC BUILD=(1:1,5,ZD,MUL,-1,TO=ZD,EDIT=(STTTTT))
                                      *             
  INCLUDE COND=(1,6,UFF,GT,+800)                   
WER268A  OUTREC STATEMENT  : SYNTAX ERROR           
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE       


Please help.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Fri Feb 28, 2014 10:43 am    Post subject: Reply with quote

In one place you use UFF in another ZD for the same data.

What do you want the output to look like? Do you want to COPY or SORT?
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Fri Feb 28, 2014 11:23 am    Post subject: Reply with quote

As you want negative numbers, i suspect you want SFF (signed) rather than UFF (unsigned)?
_________________
All the best,

di
Back to top
View user's profile Send private message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Sun Mar 02, 2014 9:27 pm    Post subject: Syncsort - convert to negative number Reply with quote

Hi,

I am trying to convert the input to its negative values based on a condition. If any input is greater than 500 then it should be converted to its negative value.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Mon Mar 03, 2014 2:19 am    Post subject: Reply with quote

Which of my two questions did you answer to clarify what you've already attempted?
Back to top
View user's profile Send private message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Mon Mar 03, 2014 3:49 am    Post subject: convert to negative values Reply with quote

Quote:

In one place you use UFF in another ZD for the same data.


I was trying with both UFF and ZD. So, I used both to see how I get the output.

Quote:

What do you want the output to look like? Do you want to COPY or SORT?


I want to have converted values appear in the output as shown below for the input numbers greater than 500.

Code:

00140P
01050}


Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Mon Mar 03, 2014 4:21 am    Post subject: Reply with quote

Is that P a typo?
Back to top
View user's profile Send private message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Mon Mar 03, 2014 7:57 am    Post subject: Reply with quote

Here is what I see with HEX ON -

Code:

 -----
00140P
FFFFFD
001407
 -----
01050}
FFFFFD
010500

_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Mon Mar 03, 2014 8:34 am    Post subject: Reply with quote

OK. we're going in circles.

You want the output SORTed, and you only want the -ve values?

If you don't want that, please show your sample input and the expected output for that, in the order that you expect it, showing -ve and +ve values if present.

You've shown attempting just about everything, and have not said what it is that you want, or shown completely and clearly what you want to happen. You're doing something simple, but without knowing what output you want for your input, it is "difficult" to help.


Last edited by William Collins on Mon Mar 03, 2014 3:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Mon Mar 03, 2014 12:43 pm    Post subject: Reply with quote

Show 10 input values and the output valjues hyou want when these are processed.

Also show any key datathat the file neds to be sequenced by (if anyu).
_________________
All the best,

di
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group