IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Initialization of a fixed decimal field


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sachin_kle

New User


Joined: 19 Dec 2005
Posts: 5
Location: Bangalore

PostPosted: Mon Dec 19, 2005 5:31 pm
Reply with quote

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
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Tue Dec 20, 2005 2:01 pm
Reply with quote

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
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Atlanta, (USA)

PostPosted: Wed Dec 21, 2005 1:11 am
Reply with quote

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
View user's profile Send private message
Nanda Krishna

New User


Joined: 30 Nov 2005
Posts: 19
Location: Bangalore

PostPosted: Fri Dec 23, 2005 4:06 pm
Reply with quote

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
View user's profile Send private message
shinjini_t

New User


Joined: 11 May 2005
Posts: 14
Location: Bangalore, India

PostPosted: Wed Dec 28, 2005 11:13 am
Reply with quote

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
View user's profile Send private message
ajmalrahman
Warnings : 1

New User


Joined: 10 Jul 2006
Posts: 2

PostPosted: Tue Jan 30, 2007 11:09 am
Reply with quote

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
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Mon Mar 26, 2007 8:54 pm
Reply with quote

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
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Mon Mar 26, 2007 8:55 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
Search our Forums:

Back to Top