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

Multiplication in DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Wed May 29, 2013 8:01 pm
Reply with quote

Is it possible in DFSORT?

Input –

Richards , 90,END
William , 9,END
Tom , 229,END

Output -

Richards , 90,5166,END
William , 9,516.6,END
Tom , 229,13144.6,END


The third field is the result of second field*57.4 (for e.g. 90*57.4 = 5166).
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: Wed May 29, 2013 8:36 pm
Reply with quote

Hello and welcome to the forum,

It is against the forum rules to post the same question multiple places.

The duplicate topic has been locked. If you are actually using Syncsort, the locked topic can be re-opened and this one deleted.

Quote:
Is it possible in DFSORT?
What happened when you tried? Post the JCL and Sort Control statements and the sysout from the run if there are questions or problems.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed May 29, 2013 9:18 pm
Reply with quote

Do you need comma delimited output? or only the output only as the same format as you have said with regard to spacing?
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Wed May 29, 2013 9:32 pm
Reply with quote

yes i need a comma delimited output. but i suppose there should not be a problem if there are leading or trailing spaces as i would email the output as a csv.
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Wed May 29, 2013 9:37 pm
Reply with quote

@ dick

I am new to this forum. i will post it under the right section from next time. i do not use SYNCSORT. Our system has IBM's DFSORT.

I tried with MUL operator in DFSORT which do not accept spaces ' 90'. Hence i tried adding leading zeroes with IFTHEN. But it did not work. I would post the JCL i tried tmrw..
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed May 29, 2013 9:49 pm
Reply with quote

Try this

Code:
//SORTIN   DD *
RICHARDS , 90,END
WILLIAM , 9,END
TOM , 229,END
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
 OPTION COPY
  INREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=9),
               %02=(ENDBEFR=C',',FIXLEN=9),
               %03=(ENDBEFR=C' ',FIXLEN=3),
               %04=(ENDAT=C' ',FIXLEN=9)),
 BUILD=(%01,C',',%02,C',',%04,C',',%03,71:%02,JFY=(SHIFT=RIGHT))
 OUTREC OVERLAY=(21:71,9,ZD,MUL,+574,EDIT=(IIIIIII.T),71:9X)


You will get the output as

Code:
RICHARDS , 90      ,   5166.0,END
WILLIAM  , 9       ,    516.6,END
TOM      , 229     ,  13144.6,END
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: Wed May 29, 2013 10:02 pm
Reply with quote

Hello,

Quote:
I am new to this forum.
Not to worry - we all were new once upon a time icon_cool.gif

I'll delete the other topic.

d
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Wed May 29, 2013 10:15 pm
Reply with quote

Pandora.. thanks a lot. will check and let you know tmrw.. icon_smile.gif

@dick.... thanks Dick... I thought the Moderator is very strict and was scared that he would block me here.. icon_rolleyes.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: Wed May 29, 2013 10:26 pm
Reply with quote

Hello,

We try to work with people. To me it makes no sense to ban (or even issue a warning) to a new person for a first-time or early posting error. Most everyone learns as they go along.

Intentional/repeat offenders are treated more firmly.

d
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu May 30, 2013 4:08 pm
Reply with quote

Richy,

A better solution as suggested by Kolusu

Code:
//STEP001  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
RICHARDS , 90,END
WILLIAM , 9,END
TOM , 229,END
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
   OPTION COPY
   INREC PARSE=(%01=(ENDAT=C',',FIXLEN=10),
                %02=(ENDAT=C',',FIXLEN=10),
                %03=(FIXLEN=51)),
   BUILD=(%01,%02,%02,UFF,MUL,+574,EDIT=(IIIIIII.T),C',',%03)


Output

Code:
RICHARDS , 90,         5166.0,END
WILLIAM ,  9,           516.6,END
TOM ,      229,       13144.6,END


Thanks Kolusu for correcting me icon_smile.gif
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Thu May 30, 2013 5:35 pm
Reply with quote

thank you.. My requirement was modified a bit.. but I was able to arrive at the desired result.

thanks again to you ppl.. I've learnt something new in DFSORT.. icon_smile.gif
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu May 30, 2013 5:55 pm
Reply with quote

Glad to know that icon_smile.gif
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top