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
 

 

Is there any justified center clause in cobol

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

New User


Joined: 25 Jun 2006
Posts: 10
Location: Bangalore

PostPosted: Wed Aug 09, 2006 4:12 pm    Post subject: Is there any justified center clause in cobol
Reply with quote

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
Back to top
View user's profile Send private message

parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Wed Aug 09, 2006 4:16 pm    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
mercy
Warnings : 1

New User


Joined: 25 Jun 2006
Posts: 10
Location: Bangalore

PostPosted: Wed Aug 09, 2006 4:29 pm    Post subject: Re: Is there any justified center clause in cobol
Reply with quote

Hi Thanq for ur reply. can you let me know how can it b done manually?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Aug 09, 2006 5:49 pm    Post subject:
Reply with quote

Simple search in Google gave me this example.

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

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Aug 13, 2006 12:13 am    Post subject:
Reply with quote

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.
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