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

Basic Field definition


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rajkumar_n

New User


Joined: 07 Dec 2006
Posts: 51
Location: Bloomington

PostPosted: Thu Aug 07, 2008 8:02 pm
Reply with quote

Hi,

I have a very basic question? sorry to post this. Need some ones advise

I have a variable defined two variables

Code:
WS-TEST-1            PIC ---,---,---.99.
WS-TEST-2            PIC ZZZ,ZZZ,ZZZ.99.

Is there any difference between two variables. Does any negotiation occur
for variable WS-TEST-1

Thanks and Regards,
Rajkumar Nerella
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 07, 2008 10:36 pm
Reply with quote

Hello,

Quote:
Is there any difference between two variables.
Yes. How might they be the same (other than overall length)?

Quote:
Does any negotiation occur for variable WS-TEST-1
What kind of negotiation do you have in mind?

What are you trying to learn? When the question is better understood, better answers should follow. . .
Back to top
View user's profile Send private message
Rajkumar_n

New User


Joined: 07 Dec 2006
Posts: 51
Location: Bloomington

PostPosted: Fri Aug 08, 2008 12:10 am
Reply with quote

I test this test case. Here are my findings

When we pass positive value to both fields

WS-TEST-1 PIC ---,---,---.99. and

WS-TEST-2 PIC ZZZ,ZZZ,ZZZ.99.

No difference is found byt when you pass negative value to above fields

WS-TEST-1 variable is good enought to hold the negative value but the second variable will not be able to hold the negative value.

Thanks and Regards,
Rajkumar Nerella
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Aug 08, 2008 3:10 am
Reply with quote

The COBOL Language Reference Manual does an excellent job of answering your question (and includes examples).
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
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
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top