MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
mf_user Intermediate Joined: 01 Jun 2003 Posts: 372 Topics: 105
Posted: Fri Feb 28, 2014 6:39 am Post subject: Syncsort - how to convert to negative number
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
mf_user Intermediate Joined: 01 Jun 2003 Posts: 372 Topics: 105
Posted: Fri Feb 28, 2014 8:20 am Post subject: Syncsort - converting to negative numbers
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:
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
William Collins Supermod Joined: 03 Jun 2012 Posts: 437 Topics: 0
Posted: Fri Feb 28, 2014 10:43 am Post subject:
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
papadi Supermod Joined: 20 Oct 2009 Posts: 594 Topics: 1
Posted: Fri Feb 28, 2014 11:23 am Post subject:
As you want negative numbers, i suspect you want SFF (signed) rather than UFF (unsigned)? _________________ All the best,
di
Back to top
mf_user Intermediate Joined: 01 Jun 2003 Posts: 372 Topics: 105
Posted: Sun Mar 02, 2014 9:27 pm Post subject: Syncsort - convert to negative number
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
William Collins Supermod Joined: 03 Jun 2012 Posts: 437 Topics: 0
Posted: Mon Mar 03, 2014 2:19 am Post subject:
Which of my two questions did you answer to clarify what you've already attempted?
Back to top
mf_user Intermediate Joined: 01 Jun 2003 Posts: 372 Topics: 105
Posted: Mon Mar 03, 2014 3:49 am Post subject: convert to negative values
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.
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
William Collins Supermod Joined: 03 Jun 2012 Posts: 437 Topics: 0
Posted: Mon Mar 03, 2014 4:21 am Post subject:
Is that P a typo?
Back to top
mf_user Intermediate Joined: 01 Jun 2003 Posts: 372 Topics: 105
Posted: Mon Mar 03, 2014 7:57 am Post subject:
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
William Collins Supermod Joined: 03 Jun 2012 Posts: 437 Topics: 0
Posted: Mon Mar 03, 2014 8:34 am Post subject:
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
papadi Supermod Joined: 20 Oct 2009 Posts: 594 Topics: 1
Posted: Mon Mar 03, 2014 12:43 pm Post subject:
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
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