IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT (OUTREC) HELP Required!!


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vinodpujari

New User


Joined: 22 Jul 2007
Posts: 6
Location: India

PostPosted: Thu Dec 04, 2008 6:46 am
Reply with quote

Hi all,

I have a requirement where i need to multiply a COMP field with a factor 0.97 for certain conditions.

I am using below sort card. it is giving syntax error.

SORT FIELDS=COPY
OUTREC FIELDS=(1:1,24,25,6,ZD,MUL,+0.97,TO=ZD,LENGTH=6,
31:31,185)

How ever if i use any factor with out decimal point (say MUL,10) then it is working.

Please help me out, as I am trying for an emergency move into production.

Thanks,
Vinod.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 04, 2008 6:54 am
Reply with quote

Hello,

Is the number COMP or Zoned-Decimal (ZD)?

What error is presented? Post the error message(s) including the message id(s).
Back to top
View user's profile Send private message
Vinodpujari

New User


Joined: 22 Jul 2007
Posts: 6
Location: India

PostPosted: Thu Dec 04, 2008 7:16 am
Reply with quote

Thanks for the reply,

i got the below error
----------------------------------------------------------------
Code:
SYSIN :                                                   
  SORT  FIELDS=COPY                                       
  OUTREC FIELDS=(1:1,24,25,6,ZD,MUL,+(.97),TO=ZD,LENGTH=6,
                                    *                     
                 31:31,185)                               
WER268A  OUTREC STATEMENT  : SYNTAX ERROR                 

----------------------------------------------------------------

Yes, the field is of type PIC S9(4)V99.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Dec 04, 2008 7:33 am
Reply with quote

Vinodpujari,

AFAIK, you can mention only an integer value for any arithmetic operation. Try changing the cards to something like this.
Code:
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,24,25,6,ZD,MUL,+97,DIV,+100,TO=ZD,LENGTH=6,
31:31,185)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 04, 2008 7:37 am
Reply with quote

Hello,

You are using Syncsort rather than DFSORT.

PIC S9(4)V99 is not COMP.

Try removing the () around the .97.

What release of Syncsort are you using? If you are not sure, it is shown at the top of the informational output from a sort execution.
Back to top
View user's profile Send private message
Vinodpujari

New User


Joined: 22 Jul 2007
Posts: 6
Location: India

PostPosted: Thu Dec 04, 2008 10:23 am
Reply with quote

Hello all,

Thanks for all the replies,

I got the solution to this problem. As I stated earlier that i cannot give decimal point values such as .97, i modified my sort step into 2 parts. In the first sort, i divide the field by 100 and in the second step i multiplied the field by 97 which effectively makes it to .97.


STEP1:
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,24,25,6,ZD,DIV,100,TO=ZD,LENGTH=6,
31:31,185)

SYSIN :
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,24,25,6,ZD,MUL,+97,TO=ZD,LENGTH=6,
31:31,185)

This worked fine.
Back to top
View user's profile Send private message
Vinodpujari

New User


Joined: 22 Jul 2007
Posts: 6
Location: India

PostPosted: Thu Dec 04, 2008 10:25 am
Reply with quote

Yup, S9(4)V99 is not Comp. It was a typo from me, sorry for that...


Anyways this problem got solved.... icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 04, 2008 10:28 am
Reply with quote

Hello,

Good to hear it is working - thank you for letting us know.

If you want to save a step (or if the volume is huge) you might want to try the code Arun suggested above. It should accomplish the multiply and the divide in the same step.
Back to top
View user's profile Send private message
Vinodpujari

New User


Joined: 22 Jul 2007
Posts: 6
Location: India

PostPosted: Thu Dec 04, 2008 10:35 am
Reply with quote

Yes, I haven't checked the code what Arun suggested. It makes more sense, i will try that later with a small change like first Div by 100 and then multiply by 97.

Thank you...
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Dec 04, 2008 11:10 am
Reply with quote

Quote:
i will try that later with a small change like first Div by 100 and then multiply by 97.
I believe changing the order will not make any difference. One more thing, you multply by 0.97 and then convert to ZD which means you lose the decimal points. Are you not interested in the decimal part?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
Search our Forums:

Back to Top