MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Null indicators in Cobol

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Thu Feb 02, 2023 10:01 am    Post subject: Null indicators in Cobol Reply with quote

The following link https://www.ibm.com/docs/en/db2/11.5?topic=hvic-null-indicator-variables-null-truncation-indicator-variable-tables-in-cobol indicates that the null indicator should be defined as COMP-5.
At the same time, this link https://www.tutorialspoint.com/how-does-dclgen-utility-accommodate-null-host-variable-for-varchar-n-data-type#:~:text=The%20NULL%20indicator%20is%20a,PIC%20S9(4)%20COMP.&text=01%20ORDER%2DDESCRIPTION%2049%20ORDER,DATA%20PIC%20X(50). (granted, not IBM) indicates that COMP (which I've always used is okay as well.
If the second line doesn't work, google "cobol sql null indicators" and you should find it

Which is it?
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Robert Sample
Beginner


Joined: 15 Dec 2009
Posts: 12
Topics: 0
Location: Atlanta

PostPosted: Thu Feb 02, 2023 10:06 am    Post subject: Reply with quote

COMP-5 is the same as COMP, except when the value exceeds the picture size. The compiler option TRUNC(BIN) will cause COMP to work the same as COMP-5.
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Thu Feb 02, 2023 10:38 am    Post subject: Reply with quote

Thanks Robert.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group