Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
s.saranya srinivasan

New User

Joined: 25 Sep 2015
Posts: 9
Location: india

 Posted: Fri Sep 25, 2015 11:43 am    Post subject: Declaration of varchar in cobol what is the equivalent varchar representation in cobol?

Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Fri Sep 25, 2015 12:18 pm    Post subject: Reply to: Declaration of varchar in cobol What does any manual say? What do your colleagues say?
s.saranya srinivasan

New User

Joined: 25 Sep 2015
Posts: 9
Location: india

 Posted: Fri Sep 25, 2015 1:27 pm    Post subject: for example name varchar (20) in cobol 05 name 49 txt pic x(20) 49 len pic s9(4) comp
s.saranya srinivasan

New User

Joined: 25 Sep 2015
Posts: 9
Location: india

 Posted: Fri Sep 25, 2015 1:38 pm    Post subject: declaration 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
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10701
Location: italy

 Posted: Fri Sep 25, 2015 1:54 pm    Post subject: Reply to: Declaration of varchar in cobol 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
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Fri Sep 25, 2015 2:04 pm    Post subject: Reply to: Declaration of varchar in cobol 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.
s.saranya srinivasan

New User

Joined: 25 Sep 2015
Posts: 9
Location: india

 Posted: Fri Sep 25, 2015 2:34 pm    Post subject: Thanks for the reply... the attached link was useful.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Missing Negative sign in COBOL jzhardy COBOL Programming 6 Sat Sep 26, 2020 11:32 am COBOL reading from SYSIN jzhardy COBOL Programming 1 Mon Sep 21, 2020 2:37 pm how to read accounting information in... jzhardy COBOL Programming 1 Mon Sep 21, 2020 9:57 am NOT IN clause in COBOL pgm mramvivek COBOL Programming 8 Thu Aug 20, 2020 4:48 am Restart logic by using cursor name in... Twinkle22 Mainframe Interview Questions 1 Wed Jul 29, 2020 11:26 am

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us