Sending data is aplhabetic size 7 (value 3000), I wantated
this value to be stored in database, which is defined as
s9(7)v9(2)comp-3.
Answers were Sorted based on User's Feedback
Answer / guest1
In the above answer the group contains a PIC clause. It
wrong. Group item should not contain any PIC clause.
01 ws-in-alpha pic x(7).
01 ws-in-numeric redefines ws-in-alpha.
05 ws-data pic 9(7)v99.
01 ws-actual-data pic s9(7)v99 comp-3.
In procedure division,
move ws-in-numeric to ws-actual-data.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / mvramesh
01 ws-in-data Pic X(7)
05 ws-numeric Pic x (4) value '3000'
05 ws-filler Pic x (1) value '.'
05 ws-decimial pic x (2) value '00'
01 WS-Temp-CHAR PIC X(6)
05 ws-num Pic x (4)
05 ws-dec Pic x (2)
01 WS-TEMP-NUM redefines WS-Temp-char pic 9(4)V9(2)
01 WS-OUT-Data PIC S9(7)V9(2) comp-3
move ws-numeric to ws-num
move ws-decimal to ws-dec
move ws-temp-num to WS-OUT-data
here is the logic, there may be syntax errors. need to modify based on the format of input data.
| Is This Answer Correct ? | 2 Yes | 4 No |
how to check whether the open command of a sequential file is successful? or not?
wirte a pgm in using files in which we hav 10 ,20,30 40...100 records in inputfile and i want them to be send to outputfile in reverse order. PLZ HELP ME OUT .........THIS IS A RECENT QUESTION IN IGATE..
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
0 Answers TryTechnicals Pvt Ltd,
Differentiate between structured cobol programming and object-oriented cobol programming.
If a sub program is called from mainprogram.I have opened cursor in main program and Fetch the result in subprogram ,Is it possible ?If yes please tell me the reason.
i am a btech cs 2009 passout. i am opting for mainframe course. is it good to do this course? pls. anyone suggest me
How to resolve the soc4 and soc7 errors?
Can we put move statement in COBOL copybook
How to delete leading spaces/blank in COBOL ? Example:- 01 data-name-1 pic x(220) " English is a language". I would like to delete leading spaces.
What is the different between index and subscript?
what is the basic concept of mainframe? what knowledge is needed for learn this mainframe?