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

Is there any data type(& level No) in Cobol like DB2 VAR


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

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Wed Feb 08, 2006 5:38 pm
Reply with quote

Hi Everybody,

I like to use an Data type(Numeric)that accepts the variable length in COBOL like DB2 VAR CHAR.Is there any Level No for the same.Please Reply Soon.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Feb 09, 2006 10:33 pm
Reply with quote

Quote:
I like to use an Data type(Numeric)that accepts the variable length in COBOL like DB2 VAR CHAR.Is there any Level No for the same.Please Reply Soon.

No there is not, why not to declare NUMERIC value with the maximum number of digits it may have....If you dont know that...give Maximum...

From Manuals FYI...

Regards,

Priyesh.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Feb 10, 2006 7:35 am
Reply with quote

Hi PK,

You can define a DB2 varchar host variable in COBOL like this:
Code:

05  your-data.
    49  yr-data-len  pic S9(4) comp.
    49  yr-data-txt  pic  X(25).


The len contains the length of the string in txt. You then use a refmod move to extract the string.

E.g. move yr-data-txt(1:yr-data-len) to some-where
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 Store the data for fixed length COBOL Programming 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top