Hi,
What we should be the declaration for an field which stores the below value. The declaration can be in working storage or PL/1 copybook layout also.
Like if 3/101, it gives value a more than 30 decimal values i.e 0.029702970297029702970.....
Thanks.
How to store a lengthy value in a field
-
- Global moderator
- Posts: 3025
- Joined: Sun Jul 04, 2010 12:13 am
- Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
- Referer: Google
- Location: Pushing up the daisies (almost)
Re: How to store a lengthy value in a field
PL/1 doesn't have copybooks - they are include members. Same thing but copybook is a COBOL term.
How many decimals are you required to store? Have you asked the analyst responsible for the design?
How many decimals are you required to store? Have you asked the analyst responsible for the design?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
Regards
Nic
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: How to store a lengthy value in a field
- No data area can hold the "complete" value you are showing. It is not possible. I'm going to break the rules and point to this Wikpedia article. You can use Google or your preferred search function to find other articles about this topic.
- Of course, you didn't bother to show us the declaration you did make. This IBM manual can offer some suggestions. Use it.
Re: How to store a lengthy value in a field
Hi NicC,
Yes, I am sorry that Pl/1 has include members not copybooks. I am a cobol developer so used that term.
I want to store the maximal possible decimals values. I have read the IBM manuals and understood that I can use BINARY or FIXED DECIMAL, but it will be great if you can tell me the solution for this.
Regards,
ritnihi.
Yes, I am sorry that Pl/1 has include members not copybooks. I am a cobol developer so used that term.
I want to store the maximal possible decimals values. I have read the IBM manuals and understood that I can use BINARY or FIXED DECIMAL, but it will be great if you can tell me the solution for this.
Regards,
ritnihi.
-
- Global moderator
- Posts: 3025
- Joined: Sun Jul 04, 2010 12:13 am
- Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
- Referer: Google
- Location: Pushing up the daisies (almost)
Re: How to store a lengthy value in a field
Search the manual for compiler limits. Robert's answer applies.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
Regards
Nic
- prino
- Posts: 641
- Joined: Wed Mar 11, 2009 12:22 am
- Skillset: PL/I - CICS - DB2 - IDMS - REXX - JCL, most in excess of three decades
- Referer: Google
- Location: Vilnius, Lithuania
- Contact:
Re: How to store a lengthy value in a field
No, you don't want to store the maximum number of digits, as that is completely useless, and would only be done by someone who is totally clueless about accuracy and significant figures.
Then again, if the description in the previous sentence matches you, and you want to really hold a few zillion digits, just convert the GNU Multiple Precision Arithmetic Library to PL/I.
Then again, if the description in the previous sentence matches you, and you want to really hold a few zillion digits, just convert the GNU Multiple Precision Arithmetic Library to PL/I.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
robert.ah.prins @ the.17+Gb.Google thingy
- Akatsukami
- Global moderator
- Posts: 1058
- Joined: Sat Oct 16, 2010 2:31 am
- Skillset: Rexx, JCL, DB2/SQL, TSO/ISPF, PL/I
- Referer: ibmmainframes
- Location: Bloomington, IL
- Contact:
Re: How to store a lengthy value in a field
ritnihi wrote:Hi NicC,
Yes, I am sorry that Pl/1 has include members not copybooks. I am a cobol developer so used that term.
I want to store the maximal possible decimals values. I have read the IBM manuals and understood that I can use BINARY or FIXED DECIMAL, but it will be great if you can tell me the solution for this.
Regards,
ritnihi.
You do not, repeat not, want to use a scale other than zero with a FIXED BINARY variable.
As the IBM Knowledge Center appears to be wedged at the moment, I will tell you that you simply have to declare a FIXED DECIMAL variable with the maximum number of digits (15 or 31, depending on compiler options), and the same as scale. I will also echo Mr. Prins' sentiment that this is a stupid and useless thing to do. If this is a requirement imposed by some clueless analyst, team lead, or manager, resist it with whatever power is yours whilst looking for another position. If this idea is yours, drop it; it's a bad one.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
-
- Similar Topics
- Replies
- Views
- Last post
-
- 1
- 1779
-
by sergeyken
View the latest post
Fri Mar 26, 2021 11:59 pm
-
- 2
- 1578
-
by sergeyken
View the latest post
Sun Jan 26, 2025 3:07 am
-
-
sort card to add zeros to varying alphanumeric field.
by longfall » Thu Mar 09, 2023 12:03 am » in DFSORT/ICETOOL/ICEGENER - 1
- 1823
-
by sergeyken
View the latest post
Thu Mar 09, 2023 2:04 am
-