Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we move SPACES to numeric field and ZEROES to
alphabetic field? If yes what are the way doing this?

Answer Posted / maneendra

Hi all,

I am adding one more point to all.
we can move spaces to numeric field without using redefines
also. it can be possible by Reference modification(The
compiler will then treat your WS-NUM field as alphanumeric.
The field length is not necessary).

sample prog and results are:
IDENTIFICATION DIVISION.
PROGRAM-ID. SPATONUM.
AUTHOR. MANEENDRA.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-NUM PIC 99.
01 WS-STR REDEFINES WS-NUM PIC XX.
PROCEDURE DIVISION.
MOVE ZEROS TO WS-NUM.
DISPLAY 'BEFORE:', WS-NUM.
MOVE SPACES TO WS-NUM(1:).
DISPLAY 'AFTER:', WS-NUM.
STOP RUN.

OUTPUT:
BEFORE:00
AFTER:

For moving numeric field to Alphanumeric field, we can pass
it directly.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

1096


What are the different open modes available in cobol?

1180


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

1188


Have you used comp and comp-3 in your project? And how?

2468


What is report-item in COBOL?

1145


Define cobol?

1384


What is amode(24)?

1225


What are the pertinent COBOL commands?

3163


Can we change the password using ALTER? anyone tried and changed?

2003


What is length is cobol?

1096


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

1109


Can you please let me know the centre name of INS certification in Kolkata.

2236


What is the difference between next sentence and continue in cobol programing language?

1210


Describe the cobol database components?

1166


i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

1527