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
 

 

Multiplication in DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Multiplication in DFSORT
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

Site Director


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

PostPosted: Wed May 29, 2013 8:36 pm    Post subject:
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

Moderator


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

PostPosted: Wed May 29, 2013 9:18 pm    Post subject:
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    Post subject: Reply to: Multiplication in DFSORT
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    Post subject: Reply to: Multiplication in DFSORT
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

Moderator


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

PostPosted: Wed May 29, 2013 9:49 pm    Post subject:
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

Site Director


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

PostPosted: Wed May 29, 2013 10:02 pm    Post subject:
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    Post subject: Reply to: Multiplication in DFSORT
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

Site Director


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

PostPosted: Wed May 29, 2013 10:26 pm    Post subject:
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

Moderator


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

PostPosted: Thu May 30, 2013 4:08 pm    Post subject:
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    Post subject: Reply to: Multiplication in DFSORT
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

Moderator


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

PostPosted: Thu May 30, 2013 5:55 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts DFSORT to match two files and write John F Dutcher DFSORT/ICETOOL 6 Thu May 12, 2016 5:17 pm


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