IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to display * without moving to new line


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2146
Location: At my coffee table

PostPosted: Tue Mar 24, 2009 5:59 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Mar 24, 2009 6:05 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Mar 25, 2009 2:31 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Mar 25, 2009 5:03 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts rewrite same SAY line CLIST & REXX 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top