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 are all the divisions of a COBOL program?

1270


In which area will you utilize 88 level items in cobol?

1210


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

1299


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

2187


How can you get the ksds file records into your cobol program?

1136


What are different data types in cobol?

1387


how do you define single dimensional array and multidimensional array in your cobol?

1151


how to move the records from file to array table. give with code example

2729


What are the access modes of START statement?

1327


In COBOL, what is the different between index and subscript?

1281


What is the use of intialize verb?

1298


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

1441


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

1185


What is the difference between PIC 9.99 and PIC9v99?

1403


Which mode is used to operate the sequential file?

1256