View previous topic :: View next topic
Author
Message
Richy12 New User Joined: 29 May 2013Posts: 22 Location: India
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
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
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
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
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
Richy12 New User Joined: 29 May 2013Posts: 22 Location: India
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
Richy12 New User Joined: 29 May 2013Posts: 22 Location: India
@ 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
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
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
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
I am new to this forum.
Not to worry - we all were new once upon a time
I'll delete the other topic.
d
Back to top
Richy12 New User Joined: 29 May 2013Posts: 22 Location: India
Pandora.. thanks a lot. will check and let you know tmrw..
@dick.... thanks Dick... I thought the Moderator is very strict and was scared that he would block me here..
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
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
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
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
Back to top
Richy12 New User Joined: 29 May 2013Posts: 22 Location: India
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..
Back to top
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
Glad to know that
Back to top
Please enable JavaScript!