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
 

 

What is the need of 49 level in db2 as well as in cobol?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
srinivas.cdp

New User


Joined: 22 Jun 2006
Posts: 4

PostPosted: Sat Dec 23, 2006 9:46 pm    Post subject: What is the need of 49 level in db2 as well as in cobol?
Reply with quote

what is the need of 49 level in db2 as well as in cobol?

Title changed from "49 level" to "what is the need of 49 level in db2 as well as in cobol?" : Priyesh.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sat Dec 23, 2006 9:50 pm    Post subject:
Reply with quote

Where do you get the idea that there is a "need" of a 49 level in either COBOL or DB2?
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


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

PostPosted: Sat Dec 23, 2006 11:22 pm    Post subject: Re: 49 level
Reply with quote

Srini...

First thing I hope you are talking about COBOL, not DB2... then there is not as such "NEED" of coding 49 level #.... It is just a way of conveying that we dont need any further sub-variables undder this variable...

Kind of coding standard... not MANDATORY....

P.S. and how about giving a proper & meaningful Title of your questions, which is self explainatory.... READ FORUM RULES....
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Dec 25, 2006 1:09 am    Post subject:
Reply with quote

You "need" 49 levels to define host variables for VARCHAR cols in DB2. The 1st 49 contains the length of the string; the 2nd the string itself. To move the string you can use refmod or the STRING stmt, eg.:
Code:

01  varchar-fld.
    49  vf-len     pic s9(004) comp.
    49  vf-data    pic  x(00n).

move vf-data(1:vf-len) to ....
PS It's the creator's responsibility to populate vf-len when vf-data is populated. When the data is written to the DB2 table it will only occupy as many bytes as the vf-len indicates even though the PIC of the host variable may be larger.

Also note that there is no "space" fill when the col is loaded into vf-data. If vf-data was 5 bytes and conained "AAAAA" then you loaded the col containing "BB" the result would be "BBAAA"
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


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