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

Move spaces to a numeric data-item


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
viji_rags

New User


Joined: 04 Jun 2010
Posts: 24
Location: chennai

PostPosted: Wed Jul 07, 2010 2:38 pm
Reply with quote

how to move spaces to a numeric data-item.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed Jul 07, 2010 2:40 pm
Reply with quote

so that You might get an abend later on ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 07, 2010 2:42 pm
Reply with quote

you can not do it directly.

MOVE SPACES TO NUM-DATA-ITEM

will generate a compiler error.

but,
I will tell you how, when you tell me why do you want to do that.
Back to top
View user's profile Send private message
viji_rags

New User


Joined: 04 Jun 2010
Posts: 24
Location: chennai

PostPosted: Wed Jul 07, 2010 2:46 pm
Reply with quote

I need these to be done in a program...how can i achieve this..
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 07, 2010 2:50 pm
Reply with quote

viji_rags wrote:
I need these to be done in a program...how can i achieve this..


no, that is not a good reason. why does it need to be done in a program.
Back to top
View user's profile Send private message
viji_rags

New User


Joined: 04 Jun 2010
Posts: 24
Location: chennai

PostPosted: Wed Jul 07, 2010 2:50 pm
Reply with quote

Can i move null-values to numeric data-item
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 07, 2010 2:52 pm
Reply with quote

obviously this is based on your other question about moving spaces to a numeric data-item.

what is your understanding of the verbiage null-values?

null-values is a non-word - only exists in your mind.
Back to top
View user's profile Send private message
viji_rags

New User


Joined: 04 Jun 2010
Posts: 24
Location: chennai

PostPosted: Wed Jul 07, 2010 2:55 pm
Reply with quote

i need to move spaces into a numeric data item and write into a file..
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Jul 07, 2010 2:58 pm
Reply with quote

This is gonna be a long conversation between Dick and the TS.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Jul 07, 2010 3:01 pm
Reply with quote

Exactly what do you want to do.
Do you want to blank out some fields in an existing file or do you want to create a file with certain fields blanked out.

But then why would you want to do that icon_confused.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Wed Jul 07, 2010 4:57 pm
Reply with quote

I pre assume that we are talking about COBOL - if yes, please show the definition of your numeric field and what do you want in that field once "the process you've described so far" is over. It will help us to help you. While showing the valuse, please use HEX values.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 07, 2010 7:00 pm
Reply with quote

The BLANK WHEN ZERO clause or Reference Modification can be used.

However, just because you can doesn't mean that you should.

But, that's your decision....

Bill
Back to top
View user's profile Send private message
ridgewalker58

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Wed Jul 07, 2010 8:11 pm
Reply with quote

Either REDEFINE the field with a PIC X clause and move spaces to that field OR place the numeric field under a GROUP LEVEL item and move spaces to that GROUP LEVEL item
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 07, 2010 8:26 pm
Reply with quote

ridgewalker58 wrote:
Either REDEFINE the field with a PIC X clause and move spaces to that field OR place the numeric field under a GROUP LEVEL item and move spaces to that GROUP LEVEL item


ah! another 'learning moment' lost.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1050
Location: Richmond, Virginia

PostPosted: Wed Jul 07, 2010 8:45 pm
Reply with quote

I agree with Dick.

This one looked like it had a chance to get OP to (1) answer the WHY question, and (2) try his basic COBOL skills.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Jul 07, 2010 8:54 pm
Reply with quote

Hello,

Quote:
I need these to be done in a program...how can i achieve this..
Why do you believe you need to corrupt some numeric value?

There are many of us who believe you do not. . . How will this corrupt value be used when it is input?

While there is a BLANK WHEN ZERO it is most often used so that there won't be lots of zeros on some user-readable output. It is not usually used for data files. . .

As was mentoned earlier, you have some reluctance about explaining what you are actually trying to accomplish. . . If you do explain, you may recieve replies that are more useful to your task at hand.
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 db2 vs static data COBOL Programming 1
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
No new posts BPXBATCH SFTP to remote path having s... All Other Mainframe Topics 6
No new posts External data queue (changes?) CLIST & REXX 0
No new posts Pull data using date difference betwe... DB2 6
Search our Forums:

Back to Top