View previous topic :: View next topic
|
Author |
Message |
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi All,
I have one number variable cobol declaration for this is below -
01 WS-NO PIC S9(09) COMP.
probable values are only two digits like - 15,27,30 etc.
I am converting this Binary value in displayble format by using EZEETRIEVE but is' taking leading zeros like - 000000015, 000000027 etc.
I want to truncate these leading zeros in Ezzetrive -
I have tried by providing MASK in output file variable as below -
I-NO 001 004 B 0
O-NO 038 009 N MASK 'ZZZZZZZ99'
but this is not working -
I know by Display option if we display the values it truncates leading zeros but that will come in SYSPRINT, I want to write it to output file directly.
Please provide your suggestions.
Thanks,
Sandip Walsinge |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Ask at your company. And also which program this is : EZEETRIEVE ? |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi Peter,
yes it is Ezeetrieve. In Ezeetrieve I want to trunacte leading zeros.
(Ezeetrive version - EASYTRIEVE PLUS 11.5-C ) |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
if You had taken an holistic approach to EZEETRIEVE You would not have had the need to ask
but why not ask one of the trainers in Your company ???
from the walsinge page
Quote: |
At Walsinge Technologies, we transform you from a conventional Engineering or Science Graduate into a leading-edge Software Engineer. We make sure you become the first preference in the process of IT Recruitment. |
what a truckload of horse manure |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Also, a minimal amount of searching/browsing will come up with replies to several questions which are the same. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Come on Bill, the TS is too busy to run his company. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, I'm feeling sorry for the people in the class, hanging on the answer to a question... |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Well as for me the TS is a f.. disgrace for the ICT profession. |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi enrico/Peter/Bill,
Thanks for your support guys, I have been member of IBMMAINFRAMES.COM since last 6 years but I never got such reply from you. I really respect u all guys for your technical knowledge.
I don't want to say anymore.
Thanks for your relplies. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Hey, the TS stripped his profile. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
let' s put things in a clear perspective ...
You say in Your profile that You are a
Director of "Walsinge technologies" ...
nobody asked You to do that
from Your company homepage Your "communication experts" incense/praise/<***lick> your company for quality, expertise, holistic vision of mainframe technologies and ... ... ...
Your course catalog provides EZEETRIEVE training
and You wonder why we are pissed ...
when we see such a poor approach to a serious profession as IT
meditate a bit, please, meditate |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well then, you should
- Know how to use the Code tags/Preview button
- Know how to spell the product you are using: EZEETRIEVE, Ezzetrive, which you clung to even when posting the real name, "EASYTRIEVE PLUS 11.5-C"
- Know to search/browse for similar questions
- Know to read the manual
- Know to search the internet
- Know not to define Cobol fields as COMP S9(9) or 9(9)
- Know not to define 9-digit fields which only need to hold two digits
- Know how people are going to react after you don't take notice of the above and post in such a manner after being on the site for six years
- etc
Sharpen-up next time, or it'll be more of the same. |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi Enrico,
I understood your guys concern, but it was not for my classes it was for my personal understaing.
It was my mistake that I it put in my signature, I appologize for that. I love mainframe and this site, I love to try things which are new to me in mainframe, it is not just for teaching, it is my personal interest.
Thanks once again. |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi Bill,
Thanks for your suggestions, going forward I will take of these things. |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi Sandip,
With littile search and trial-error its easily doable
Try belwo code
Declarations
Code: |
I-NO 001 004 B 0
DEFINE I-NO-NUM W 16 N VALUE 0
DEFINE I-NO-NUM-BYTE I-NO-NUM 1 N OCCURS 16
DEFINE I-NO-ALPHA W 16 A
DEFINE I-NO-ALPHA-BYTE I-NO-ALPHA 1 A OCCURS 16
DEFINE C-SUB W 2 N
DEFINE D-SUB W 2 N
DEFINE WS-CHECK W 1 A VALUE ' ' |
Code
Code: |
I-NO-NUM = I-NO
D-SUB = 0
C-SUB = 0
WS-CHECK = 'Y'
DO WHILE C-SUB LE +15
C-SUB = C-SUB + 1
IF I-NO-NUM-BYTE (C-SUB) NE 0
D-SUB = D-SUB + 1
I-NO-ALPHA-BYTE (D-SUB) = I-NO-NUM-BYTE (C-SUB)
WS-CHECK = 'N'
ELSE
IF WS-CHECK NE 'Y'
D-SUB = D-SUB + 1
I-NO-ALPHA-BYTE (D-SUB) =I-NO-NUM-BYTE (C-SUB)
END-IF
END-IF
END-DO |
At the end of Do-While Loop I-NO-ALPHA will have value without leading zeros.
See if this works for you..
Regards,
Chandan |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Remember to set I-NO-ALPHA to space before the loop.
No need for 16 digits, as field only has nine.
You could just "redefine" the 16 N 0 as 16 x 1 A and clobber leading zeros to space, rather than move non-leading-zero digits individually.
Gets trickier with "other editing" required, rather than just the suppression of leading zeros.
If I write an entire Cobol sub-program for this, can you test it, chandan-inst? |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
oops my bad.. I missed to mention regarding initializing I-NO-ALPHA
Agree with you Bill.. No need of 16 bytes there
It was a ready code available with me and thats the reason I missed to change the 16 to 9/
I did it with trial and error which is the only thing probably TS missed else he could have get his done esily.
Yes Bill I can test this Out.
Writing a cobol sub program is much easier option just we need to call that program for every conversion.
Regards,
Chandan |
|
Back to top |
|
|
|