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

Removing the Trailing spaces after move


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
samayamsasi
Warnings : 1

New User


Joined: 22 May 2005
Posts: 7
Location: Bangalore

PostPosted: Mon Mar 19, 2007 2:38 pm
Reply with quote

Guys,

now i am facing the below problem

i had two variables(X,Y)
when i moving X to Y . the variable:y contain the Trailing spaces, i don't want that

if x contain 2 then y should contain 2(with out sapces,After moving the X to Y)

if x contain 22 then y should contain the 22 (with out spaces,After moving the X to Y)

Regards,
Sasi
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 2:46 pm
Reply with quote

For an urgent question you don't give much detail.... icon_rolleyes.gif
What language?
What is the data description of the two fields?
If you don't want trailing spaces, what do you want? Trailing question marks????
Back to top
View user's profile Send private message
samayamsasi
Warnings : 1

New User


Joined: 22 May 2005
Posts: 7
Location: Bangalore

PostPosted: Mon Mar 19, 2007 2:57 pm
Reply with quote

william,

a)this is cobol program

b) 05 X PIC X(10)
05 Y PIC X(10)

c) my requirement is Y should contain the value with outspaces
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 3:10 pm
Reply with quote

Since they are the same size, everything and anything in X will be moved to Y.
If X contains any spaces, then Y will recieve those spaces.
Your "requirement" doesn't make much sense, could you expand on it?
Back to top
View user's profile Send private message
samayamsasi
Warnings : 1

New User


Joined: 22 May 2005
Posts: 7
Location: Bangalore

PostPosted: Mon Mar 19, 2007 4:38 pm
Reply with quote

they r the same size,

if x contain the value 2 with remaining spaces , when i moved( x to y)
i want the values of Y is 2 only i no need spaces

same as above if i x contain 22 with remaining spaces, when i moved (X to y) in this case also y shoudget 22 with out spaces
.............
..............

Thanks
Sasi
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 4:54 pm
Reply with quote

Are you trying to move for instance the "22" of the "22bbbbbbbb" in X to the first two positions in Y without overlaying the other 8 positions in Y?
Something line move X(1:2) to Y(1:2)?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 19, 2007 7:52 pm
Reply with quote

Hello,

Your output field is x(10) - so 10 bytes must be accounted for. If you do not want spaces in the trailing positions what do you want? There is no dynamic "squeeze" function that changes the picture/length of your output field to the length of the data before the trailing space(s).
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
Search our Forums:

Back to Top