View previous topic :: View next topic
|
Author |
Message |
kishpra
New User
Joined: 24 May 2010 Posts: 92 Location: Pune
|
|
|
|
Hi,
I am using the below to get the count -
OPTION COPY
OUTFIL TRAILER1=(1:'CCCREJR',8:'|',9:COUNT=(M11,LENGTH=8)),
REMOVECC,NODETAIL
I am getting the output as -
CCREJR|00000025
Now I want the output of sort as -
CCREJR|25
i.e. without leading zeroes. If i am removing M11, it gives me 6 spaces followed by 25 which I don't need.
Thanks. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
25 is still 25 no matter how many leading zeros. There is an example here, if I remember correctly, but it is overkill for something which does not matter. |
|
Back to top |
|
|
kishpra
New User
Joined: 24 May 2010 Posts: 92 Location: Pune
|
|
|
|
But it matters to the person who reads input file through program. It doesn't accept leading spaces or zeroes.
Thanks |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
very little flexibility around there ...
even the most stupid program can read and understand a number with leading zeros |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, that's funny, but look at this for such a task if the receiver continues to keep a straight face. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
kishpra wrote: |
But it matters to the person who reads input file through program. It doesn't accept leading spaces or zeroes. |
Master of the Universe! The "programmer" who wrote that input routine would have had to go out of his way to write such a piece of slop. Perhaps that program should be modified instead. |
|
Back to top |
|
|
kishpra
New User
Joined: 24 May 2010 Posts: 92 Location: Pune
|
|
|
|
Please assist on any change that can be done in the sort card to remove leading zeroes or spaces from COUNT |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
kishpra wrote: |
Please assist on any change that can be done in the sort card to remove leading zeroes or spaces from COUNT |
not only do people not read manuals or search for existing solutions,
but they do not even look at suggestions provided.
Kishpra,
look at Bill Woodger's last post. He provided a direct link to the solution.
Even though it says Syncsort, the sort cards provided also work w/DFSORT. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Note also that it will be formatting the count for each input record. Means client paying for more CPU on the Mainframe, rather than the program that can't understand that 025 is the same as 25 is the same as 000000000000000025 being changed. Heck, even Excel understands it, you have to go out of your way to make it not work. |
|
Back to top |
|
|
kishpra
New User
Joined: 24 May 2010 Posts: 92 Location: Pune
|
|
|
|
Thanks for the reply.
it is not working for me as -
OUTFIL TRAILER1=(1:'CCCREJR',8:'|',9:COUNT=(LENGTH=8),SQZ=(SHIFT=LEFT)),
REMOVECC,NODETAIL
it is giving me error.
Pelase assist. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
would it be a problem for You to tell what DOES NOT WORK and the error You receive ???. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, you changed it. Please look at the original example. Other than there being two counts, it is the same requirement as yours. So you can't just take some of the code from one place and put it in another, more convenient, place. Arun would have thought of that originally. The reason he wrote that code is because you can't, at all, do what you just tried.
Re-read the link. Re-code. Remember that I noted you have to do it on each record. If that is true, how did you even think you could just add it to the TRAILER1? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Note also that it will be formatting the count for each input record. Means client paying for more CPU on the Mainframe, rather than the program that can't understand that 025 is the same as 25 is the same as 000000000000000025 being changed. Heck, even Excel understands it, you have to go out of your way to make it not work. |
|
Back to top |
|
|
|