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
 
Removing the Trailing spaces after move

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Removing the Trailing spaces after move
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: 3158
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 2:46 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 3:10 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 4:54 pm    Post subject:
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

Site Director


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

PostPosted: Mon Mar 19, 2007 7:52 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm

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