Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT (OUTREC) HELP Required!!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT (OUTREC) HELP Required!!
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

Site Director


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

PostPosted: Thu Dec 04, 2008 6:54 am    Post subject:
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    Post subject: Reply to: SORT (OUTREC) HELP Required!!
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: 2181
Location: @my desk

PostPosted: Thu Dec 04, 2008 7:33 am    Post subject:
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

Site Director


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

PostPosted: Thu Dec 04, 2008 7:37 am    Post subject:
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    Post subject: Reply to: SYNCSORT (OUTREC) HELP Required!!
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    Post subject: Reply to: SYNCSORT (OUTREC) HELP Required!!
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

Site Director


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

PostPosted: Thu Dec 04, 2008 10:28 am    Post subject:
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    Post subject: Reply to: SYNCSORT (OUTREC) HELP Required!!
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: 2181
Location: @my desk

PostPosted: Thu Dec 04, 2008 11:10 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us