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 comp-1 and comp-2?

1185


What is inspect in cobol ?

1241


Can a Search can be done on a table with or without Index?

1235


how to convert the recors form vsam file to db2 table tru file aid

3209


What is the difference between Global and External Variables?

1294


How to remove 2 duplicate records and copy only one using job control language?

1169


) how do u code after getting data?

2074


Mention the guidelines to write a structured cobol program?

1028


What is the default value(s) for an initialize and what keyword allows for an override of the default?

1155


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

1142


How are the next sentence and continue different from each other?

1225


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

1451


What type of SDLC u followed? Why?

1957


State the various causes of s0c1, s0c5 and s0c7.

1026


How do you reference the following file formats from cobol programs?

1120