Can we move SPACES to numeric field and ZEROES to
alphabetic field? If yes what are the way doing this?
Answer Posted / siva
yes, we can move accordingly thru REDEFINES clause.
Example :
01 WS-A PIC 9(5).
01 WS-AR REDEFINES WS-A PIC X(5).
01 WS-B PIC A(5).
01 WS-BR REDEFINES WS-B PIC X(5).
MOVE 12345 TO WS-A.
MOVE SPACES TO WS-AR.
MOVE 'ABCDE' TO WS-B.
MOVE ZEROES TO WS-BR.
WS-A, WS-AR contains spaces and WS-B, WS-BR contains
zeroes.
| Is This Answer Correct ? | 19 Yes | 1 No |
Post New Answer View All Answers
I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
What is comp-1 and comp-2?
Name some of the examples of COBOl 11?
I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
What is the difference between goback, stop run and exit program in cobol?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
What is the default value(s) for an initialize and what keyword allows for an override of the default?
how do you reference the rrds file formats from cobol programs
What is the usage of comp fields in cobol?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
Have you used comp and comp-3 in your project? And how?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
How do you get the data to code the BMS macro?