Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Vinodpujari

New User

Joined: 22 Jul 2007
Posts: 6
Location: India

 Posted: Thu Dec 04, 2008 6:46 am    Post subject: SYNCSORT (OUTREC) HELP Required!! 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.

dick scherrer

Site Director

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

 Posted: Thu Dec 04, 2008 6:54 am    Post subject: Hello, Is the number COMP or Zoned-Decimal (ZD)? What error is presented? Post the error message(s) including the message id(s).
Vinodpujari

New User

Joined: 22 Jul 2007
Posts: 6
Location: India

Posted: Thu Dec 04, 2008 7:16 am    Post subject: Reply to: SORT (OUTREC) HELP Required!!

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.
Arun Raj

Moderator

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

Posted: Thu Dec 04, 2008 7:33 am    Post subject:

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)
dick scherrer

Site Director

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

 Posted: Thu Dec 04, 2008 7:37 am    Post subject: 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.
Vinodpujari

New User

Joined: 22 Jul 2007
Posts: 6
Location: India

 Posted: Thu Dec 04, 2008 10:23 am    Post subject: Reply to: SYNCSORT (OUTREC) HELP Required!! 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.
Vinodpujari

New User

Joined: 22 Jul 2007
Posts: 6
Location: India

 Posted: Thu Dec 04, 2008 10:25 am    Post subject: Reply to: SYNCSORT (OUTREC) HELP Required!! Yup, S9(4)V99 is not Comp. It was a typo from me, sorry for that... Anyways this problem got solved....
dick scherrer

Site Director

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

 Posted: Thu Dec 04, 2008 10:28 am    Post subject: 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.
Vinodpujari

New User

Joined: 22 Jul 2007
Posts: 6
Location: India

 Posted: Thu Dec 04, 2008 10:35 am    Post subject: Reply to: SYNCSORT (OUTREC) HELP Required!! 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...
Arun Raj

Moderator

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

Posted: Thu Dec 04, 2008 11:10 am    Post subject:

 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?
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics OUTREC OVERLAY different to INCREC ge... Joerg.Findeisen SYNCSORT 8 Fri Apr 27, 2018 2:11 am Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm Receommendations required for adding ... Alan Playford JCL & VSAM 5 Wed Feb 14, 2018 4:01 pm OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us