| IBM MAINFRAME HELP & SUPPORT FORUMS Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
|
| View previous topic :: View next topic |
| Author |
Message |
sachin_kle
Joined: 19 Dec 2005
Posts: 5
Location: Bangalore
|
| Posted: Mon Dec 19, 2005 5:31 pm Post subject: Initialization of a fixed decimal field |
|
|
Hi,
I have a structure with the following declaration:
01 STRUC1,
05 SRI_CREATED CHAR(26),
05 RECEIPT_AMT DEC FIXED(15,2),
05 RECEIPT_AMT DEC FIXED(15,2);
If i initialize
STRUC1 = '';
What will be the values in the character and FIXED DEC field? |
|
| Back to top |
|
parikshit123
Joined: 01 Jul 2005
Posts: 279
Location: India
|
| Posted: Tue Dec 20, 2005 2:01 pm Post subject: |
|
|
Hi Sachin,
As far as I know, there is no concept of structure in COBOL ( like in C).
Also, initialization in COBOL can be done with INITIALIZE verb.
there are no data types like CHAR and DEC FIXED
.
As far as your question is concerned, if you initialize a group item, Low values(lowest values in collating sequence) is moved into all the items of the given group item ( structure !) ..
I hope it was helpful.
Please let me know if you need further clarification to this.. |
|
| Back to top |
|
muffirulz
Joined: 14 Sep 2005
Posts: 50
Location: Kentucky, USA
|
| Posted: Wed Dec 21, 2005 1:11 am Post subject: Re: Initialization of a fixed decimal field |
|
|
hi,
man you are combining cobol and C.
i dont think so there is any command as struct in cobol
as far as initialization is concerend then we can do it by initialize verb |
|
| Back to top |
|
Nanda Krishna
Joined: 30 Nov 2005
Posts: 16
Location: Bangalore
|
| Posted: Fri Dec 23, 2005 4:06 pm Post subject: |
|
|
Hey!
The question is related with PL/I, not with Cobol. In PL/I we have the concept of Structures.
Sachin,
As per what i know ... there is no " (double quote) in the PL/I Character sets. So, it will give compilation error when u assign STRUC1 = '' ; |
|
| Back to top |
|
shinjini_t
Joined: 11 May 2005
Posts: 14
Location: Bangalore, India
|
| Posted: Wed Dec 28, 2005 11:13 am Post subject: |
|
|
Hi Sachin,
If you initialise STRUC1 = '';
then the CHAR Variable will have hexadecimal blanks and teh FIXED DEC will be populated with hexadecimal zeroes.
Shinjini |
|
| Back to top |
|
ajmalrahman
Joined: 10 Jul 2006
Posts: 2
|
| Posted: Tue Jan 30, 2007 11:09 am Post subject: Declaration of Fixed DEC to Fixed BIN. |
|
|
| what is declaration in FIXED BIN which exactly use the space storage of FIXED DEC(15) , Fixed Dec(9) and vise versa |
|
| Back to top |
|
cheryala
Joined: 20 Mar 2006
Posts: 49
|
| Posted: Mon Mar 26, 2007 8:54 pm Post subject: Re: Initialization of a fixed decimal field |
|
|
Hello ajmalrahman,
UNSIGNED FIXED BIN (64,0) and SIGNED FIXED BIN(63,0) declarations occupy the storage that same as FIXED DEC(15).
When comes to your second question ........
Fixed Dec(9) occupies 5 bytes and you cannot declare any fixed bin variable which occupies 5 bytes..All fixed bin varibles occupy 2,4 or 8 bytes depending up on the precision of the variable.. |
|
| Back to top |
|
cheryala
Joined: 20 Mar 2006
Posts: 49
|
| Posted: Mon Mar 26, 2007 8:55 pm Post subject: Re: Initialization of a fixed decimal field |
|
|
Hello ajmalrahman,
UNSIGNED FIXED BIN (64,0) and SIGNED FIXED BIN(63,0) declarations occupy the storage that same as FIXED DEC(15).
When comes to your second question ........
Fixed Dec(9) occupies 5 bytes and you cannot declare any fixed bin variable which occupies 5 bytes..All fixed bin varibles occupy 2,4 or 8 bytes depending up on the precision of the variable.. |
|
| Back to top |
|
| |
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
|