Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to display * without moving to new line

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

New User


Joined: 20 Apr 2007
Posts: 13
Location: chennai

PostPosted: Tue Mar 24, 2009 5:43 pm    Post subject: how to display * without moving to new line
Reply with quote

hi,

when i execute the following coding.

perform 5 times
display "*"
end-perform.

it displays
*
*
*
*
*

but in output i need like this *****.
i don't want the character to go into newline.how can i achieve this.
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Mar 24, 2009 5:59 pm    Post subject: Reply to: how to display * without moving to new line
Reply with quote

What is wrong with this?

perform 1 times
display "*****"
end-perform.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8195
Location: East Dubuque, Illinois, USA

PostPosted: Tue Mar 24, 2009 6:05 pm    Post subject:
Reply with quote

I don't believe what you're wanting can be done. DISPLAY goes to the next line starting at position one unless WITH NO ADVANCING is used. If WITH NO ADVANCING is added to the DISPLAY, a + carriage control character is used instead of space but the DISPLAY still starts at position one each time.

Either use CICS Guy's suggestion, or use a STRING command to build your output characters and then use a single DISPLAY statement.
Back to top
View user's profile Send private message
inbasekarmani
Warnings : 2

New User


Joined: 20 Apr 2007
Posts: 13
Location: chennai

PostPosted: Wed Mar 25, 2009 2:21 pm    Post subject: Reply to: how to display * without moving to new line
Reply with quote

hi robert sample,

please tell how to use no advancing with display with an example.i already know the cicsguy coding which i don't want and i should not use string operation.I am thinking what are other ways to achieve this.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10373
Location: italy

PostPosted: Wed Mar 25, 2009 2:31 pm    Post subject: Reply to: how to display * without moving to new line
Reply with quote

why You want to make things more complicated than they are??

express/describe logical/rational/business requirement,
i want/I do not want are not enough to have people spend time to answer You

Quote:
... am thinking what are other ways to achieve this ...

go ahead and find them, but do not ask us to do it or You
CICS guy suggestion
Code:
display "*****"

is simple and effective, what else icon_eek.gif
Back to top
View user's profile Send private message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Wed Mar 25, 2009 3:27 pm    Post subject: Reply to: how to display * without moving to new line
Reply with quote

Quote:
please tell how to use no advancing with display with an example
You wont be able to achieve this with no advancing feature.Please go through the following link :WITH NO ADVANCING
As everyone has suggested,please go by the simple approach.

WTF
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8195
Location: East Dubuque, Illinois, USA

PostPosted: Wed Mar 25, 2009 5:03 pm    Post subject:
Reply with quote

Code:
DISPLAY '*'  WITH NO ADVANCING
is the syntax. To reiterate what I said earlier, though, it will not do what you want -- you will get one asterisk in column 2, repeated 4 times with overprint. There will not be any asterisks in columns 3, 4, 5, or 6.
Back to top
View user's profile Send private message
ramdantu

New User


Joined: 24 Nov 2004
Posts: 3

PostPosted: Wed Mar 25, 2009 7:40 pm    Post subject: Reply to: how to display * without moving to new line
Reply with quote

Hi

Yes, as per your code it will display the "*" line by line only because your display statement is get execute one by one for 5 times. ie., each time it takes as one new line.
To avoid this you can use the Row&Column and display it.
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 Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Moving UDB database to Db2 on z/OS Keith Hooley DB2 4 Wed Sep 27, 2017 12:38 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us