View previous topic :: View next topic
|
Author |
Message |
sachin_kle
New User
Joined: 19 Dec 2005 Posts: 5 Location: Bangalore
|
|
|
|
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
Active User
Joined: 01 Jul 2005 Posts: 269 Location: India
|
|
|
|
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
New User
Joined: 14 Sep 2005 Posts: 74 Location: Atlanta, (USA)
|
|
|
|
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
New User
Joined: 30 Nov 2005 Posts: 19 Location: Bangalore
|
|
|
|
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
New User
Joined: 11 May 2005 Posts: 14 Location: Bangalore, India
|
|
|
|
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 Warnings : 1 New User
Joined: 10 Jul 2006 Posts: 2
|
|
|
|
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
New User
Joined: 20 Mar 2006 Posts: 46
|
|
|
|
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
New User
Joined: 20 Mar 2006 Posts: 46
|
|
|
|
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 |
|
|
|