Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Basic Field definition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Basic Field definition
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

Site Director


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

PostPosted: Thu Aug 07, 2008 10:36 pm    Post subject:
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    Post subject: Basic Field definition
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: 1239
Location: Richfield, MN, USA

PostPosted: Fri Aug 08, 2008 3:10 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us