Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1249
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 How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us