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

Author Message
mercy
Warnings : 1

New User

Joined: 25 Jun 2006
Posts: 10
Location: Bangalore

 Posted: Wed Aug 09, 2006 4:12 pm    Post subject: Is there any justified center clause in cobol Hi, I am preparing a report using cobol.Is there any function available to justify the text at the center of the line.The printed text is of variable length. Thanq

parikshit123

Active User

Joined: 01 Jul 2005
Posts: 269
Location: India

 Posted: Wed Aug 09, 2006 4:16 pm    Post subject: Hi , I don't think we have either an inbuilt function to do that or a "justify center" clause. You have to do it manually. thanks, Parikshit.
mercy
Warnings : 1

New User

Joined: 25 Jun 2006
Posts: 10
Location: Bangalore

 Posted: Wed Aug 09, 2006 4:29 pm    Post subject: Re: Is there any justified center clause in cobol Hi Thanq for ur reply. can you let me know how can it b done manually?
ofer71

Global Moderator

Joined: 27 Dec 2005
Posts: 2360
Location: Israel

 Posted: Wed Aug 09, 2006 5:49 pm    Post subject: Simple search in Google gave me this example. O.
mmwife

Super Moderator

Joined: 30 May 2003
Posts: 1592

 Posted: Sun Aug 13, 2006 12:13 am    Post subject: H Mercy, You can try something like this: Determine the length of the string. I'll call it STR-LEN Subtract the length of the string from the length of the receiving variable. Divide that by 2 and add 1. Use the result as the position of the starting point of the sending string in the receiving field. I'll call it STR-POS Move the string to the receiving variable using: MOVE SPACES TO RECV-VAR MOVE SEND-VAR(:STR-LEN) TO RECV-VAR(STR-POS:) For ex: String len = 10 String pos = 16 Var len = 40 The move stmt will move the 10 byte string to pos 16 of the receiving field (leaving 15 leading spaces) and it will occupy pos 16 thru 25 there, leaving 15 trailing spaces.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Issue in suppressing leading zeros &a... Vijay_Sirisha COBOL Programming 21 Thu Jun 07, 2018 8:01 pm VBS to VB in COBOL and JCL srajendran2 COBOL Programming 12 Fri Jun 01, 2018 3:04 am Reformat clause in joinkeys sortcard ... Mounika Nemani DFSORT/ICETOOL 2 Thu May 31, 2018 5:35 pm Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm

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