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
 

 

Declaration of varchar in cobol

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

New User


Joined: 25 Sep 2015
Posts: 9
Location: india

PostPosted: Fri Sep 25, 2015 11:43 am    Post subject: Declaration of varchar in cobol
Reply with quote

what is the equivalent varchar representation in cobol?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Sep 25, 2015 12:18 pm    Post subject: Reply to: Declaration of varchar in cobol
Reply with quote

What does any manual say? What do your colleagues say?
Back to top
View user's profile Send private message
s.saranya srinivasan

New User


Joined: 25 Sep 2015
Posts: 9
Location: india

PostPosted: Fri Sep 25, 2015 1:27 pm    Post subject:
Reply with quote

for example

name varchar (20)

in cobol

05 name
49 txt pic x(20)
49 len pic s9(4) comp
Back to top
View user's profile Send private message
s.saranya srinivasan

New User


Joined: 25 Sep 2015
Posts: 9
Location: india

PostPosted: Fri Sep 25, 2015 1:38 pm    Post subject: declaration
Reply with quote

one more question

in comp
how they are saying 9(4) means 2 bytes??

Data name length Length in COBOL
9(01) to 9(04) 2 bytes
9(05) to 9(09) 4 bytes
S9(10) to S9(18) 8 bytes
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Fri Sep 25, 2015 1:54 pm    Post subject: Reply to: Declaration of varchar in cobol
Reply with quote

the POP ( principles of operations )

available here
http://www-01.ibm.com/support/docview.wss?uid=isg2b9de5f05a9d57819852571c500428f9a

or here
http://www-03.ibm.com/systems/z/os/zos/bkserv/r11pdf/#zarchpops

will tell all You might want to know about numeric data representation
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Sep 25, 2015 2:04 pm    Post subject: Reply to: Declaration of varchar in cobol
Reply with quote

And don't define it as COMP, use COMP-5, for sure if you variable data may be greater than 9999 bytes, and it is good practice for the next copy/paste.
Back to top
View user's profile Send private message
s.saranya srinivasan

New User


Joined: 25 Sep 2015
Posts: 9
Location: india

PostPosted: Fri Sep 25, 2015 2:34 pm    Post subject:
Reply with quote

Thanks for the reply...
the attached link was useful.
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 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
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 2 Tue May 09, 2017 6:31 pm


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