Have you tried doing this -
Code
MOVE FUNCTION REVERSE(WS-A) TO WS-B
Yes we can reverse a string by using move reference modification concept
eg:01 name pic x(4).
01 rname pic x(4).
move name(1:1) to rname(4:1).
move name(2:1) to rname(3:1).
move name(3:1) to rname(2:1).
move name(4:1) to rname(1:1).
Can redefines clause be used in file section, if yes at which level number ?
Cant used redefines clause in file-section.
Code
01 CUSTOMER-DATA. 05 CUSTOMER-ID PIC X(10). 05 CUSTOMER-ID-PARTS REDEFINES CUSTOMER-ID. 10 LOCATION PIC X(3). 10 NAME-ABREV PIC X(5).
Can we use redefine clause in occurs clause?
NO.occurs cant be redefined.
no. why because occurs cant be used for redefines clause.
Chkpt and commit in cobol-ims pgm.
How to create chkpnt and commit in imsdb-ocobol pgm.?
This Checkpoint/Restart logic is for the commit for the 100 ISRT/DLET IMS calls. In Data Division first we need to give both restart length and checkpoint length as below. 01 RESTART-SEGMENT-LENGTH ...
How to pass the parameter in parm using linkage section ? (syntax)?
PARM is used to pass data from JCL to COBOL
we can pass max of 100 bytes
first 2 bytes are reserved to length
thus we can pass only 98 bytes of data
--------------
Let me know if u need more information
in jcl:
in cobol :Code
step1 execf pgm=xyz,parm=raghava
Code
linkage section 05 ln-var. 10 ln-temp pic x(10). procedure division using ln-var.
Usage of copy statement in cobol
Hi, can any one tell how to use copybook in cobol, and please explain with file structure(means I am using 5 fields of file and I want to declare them in copybook and and I want use it in cobol programming)
Don't forget to specify the library where that copy book resides ie.., in SYSLIB
Workinfg-storage section. pds: TEST.RASH.LIB.ABC.COPY(COPYBK1) 02 VAR-LIST. 05 VAR1 PIC X(10) 05 VAR2 PIC X(10) 05 VAR3 PIC X(10) 05 VAR4 PIC X(10) 05 VAR5 PIC X(10) TEST.RASH.LIB.ABC.PROG(TESTP...
SOC7 ERROR bcaz whenever ws-var1 is redefined by ws-var2 (num),the numeric pic 9(5) stands in-front of Alphanumeric pic x(5) and so it takes the values anything that comes to ws-var1.if once any varia...
WS-VAR1='ABCDE' and WS-VAR2=Junk or LOW-Values.
If we will MOVE 'ABCDE' TO WS-VAR2. Then it will give SOC abend.
XRef data is written for Assembler, COBOL, or PL/I programs. XREF makes the Compiler produce a cross-reference listing. XRef data is written for the file and each field in the file that are accessed in the program using an
EXEC ADABAS GENERATE or a COPY statement.
Where do use low-value and high-value in cobol. Also explain which kind of values they represent?
One correction in example given above post ofr Ifrank. We can not move HIGH-VALUES/LOW-VALUES to PIC 9 (NUMERIC FIELD) . We can onlye move in PIC X (ALPHANUMERIC)
LOW-VALUE represents X'00' and HIGH-VALUE represents X'FF'. These equate to the lower and upper limits of the collating sequence. All other values fall in between. There are...
In COBOL :=> Before execution get both the files in sorted order say Ascending. In PGM use Evaluate statement as Evaluate when Rec_key_ file_1 = Rec_key_ file_2 Write rec. read file1. Read file2. ...
"cobol //SORT1 EXEC PGM=SORT //SORTJNF1 DD * 00000111111 000001234567 LOCAL ===== 00000333333 000003456789 LOCAL ===== 00000555555 000005678901 EXTRN ===== 00000666666 0000067...
Which division in a cobol program contains the description of incoming and outgoing data?
Data Division
How do you delete specific record using cobol
I want delete one record from the file that is50 th record how can we delete ...?
In normal dasds the data cant be deleted where we like for that ksds vsam files are used there we have option of index and randomly picking of data we want.So by file handling we can delete the 50th r...
It is NOT possible to delete records of a seq file. If you do not want a specific record to be kept in a seq file any more, all you can do is to modify the contents of the record so that it contains s...
How do you read a file in reverse order through cobol program?
I have never seen any keyword like REVERSE or REVERSED in COBOL. - If you want to read the file in reverse order, first sort you file so that you get the records in reverse order then read the file s...
I tried REVERSE and REVERSED, but compiler is not recognizing them as keywords. We can achieve this by using SORT.
Inspect is a kind String function in COBOL, examples given by PKK are pretty good
Individual characters in a field can be accessed and possibly changed by use of the INSPECT verb. INSPECT is used with TALLYING option to count designated characters. eg: INSPECT WS-A TALLYING...
What is file status 39 in cobol?
Lrecl and block size mismatch .Can anyone explain in detail...
Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm & the JCL (or the dataset label). You will get file status 39 on an OPEN.
Actually Index is a register variable in COBOL, which will tell about the displacement ; as Subscripts are telling about the occurrences only. And there will be no need to declare them in Working Storage section.
Index can be used to search the data in tables. Here Index represents the searching coloumn or field value of the table.
A pic x(1) value a.B pic x(2) value spaces.If move a to b. What is the value of b. Is it ' a' or 'a '.
The answer is A
alpha numeric data insertion is write justification so the answer is "a "
What is difference between comp & comp-4?
Not always correct. In our computer Comp = Comp-3.
So always check the manual of the compiler.
For all of you out who have not heard about comp-4. Wake up. Comp-4 does exist and it is just like comp - ie. it is a half-word (2 bytes).This might help those of you who are confused about comp ...
What is the difference between copy and include
I have used COPY in simple COBOL program (without DB2) and my program got compiled with return code 0. I think we can use the COPY for programs which doesnt use DCLGEN? Plz correct me if I am wrong.
include means it expands the statements in the precompilation time but copy means it just retrieves the statements at compile time.
Editorial / Best Answer
Answered by: venkat65318
Member Since Sep-2009 | Answered On : Sep 13th, 2009
In Cobol there are 4 divisions.
1. Identification division or ID division
In this no setions are there. It has 5 paragraphs.
a. Progaram-id. programname
b. Author
c. Writen-date
d. Compiled-date
e. Installer
2. Environment Division
Under this there are two sub-sections
a. Configuration-section.
Source compter.
Object computer.
b. Input-Output section.
File control.
IO control.
3. Data Division
File-section.
Working-storage section.
Linkage section.
Report section.
Screen section.
4. Procedure Division
There is another section in Data division; named as LOCAL-STORAGE SECTION.
For a recursive cobol program, you need to use that section to hold the current values of each variable while the program run.
Regards,
Saurabh Bandyopadhyay.
Mainframe Developer, India.
IDENTIFICATION DIVISION */ mandatory */should contain PROGRAM-ID ENVIRONMENT DIVISION ...