Explain about RECORDING MODE Clause
RECORDING MODE clause specifies the format of the physical records
Recording mode F (fixed) -
Recording mode V (variable)
Recording mode U (fixed or variable)
Recording mode S (spanned)
FILE-CONTROL.
SELECT INPUTF ASSIGN TO INF.
SELECT OUTPUTF ASSIGN TO OUT.
SELECT WORK ASSIGN TO WRK.
DATA DIVISION.
FILE SECTION.
FD INPUTF.
01 INPUT-STUDENT.
05 STUDENT-ID-I PIC 9(6).
05 FILLER PIC X(74).
FD OUTPUTF.
01 OUTPUT-STUDENT.
05 STUDENT-ID-O PIC 9(6).
05 FILLER PIC X(74).
SD WORK.
01 WORK-STUDENT.
05 STUDENT-ID-W PIC 9(6).
05 FILLER PIC X(74).
WORKING-STORAGE SECTION.
01 VAR1 PIC 9.99 VALUE '124'.
01 STRING1 PIC X(10) VALUE 'ARPITA' .
01 STRING2 PIC X(10) VALUE SPACES.
01 VAR2 PIC 9.99 VALUE '1.24'.
01 VAR3 PIC 9.99 VALUE '.123'.
01 VAR4 PIC 9.99 VALUE '12.4'.
* 01 VAR5 PIC 9V99 VALUE '1.23'.
01 VAR6 PIC 9.99 VALUE '12.5' .
01 VAR7 PIC 9V99.
PROCEDURE DIVISION.
SORT WORK ON ASCENDING KEY STUDENT-ID-W
USING INPUTF GIVING OUTPUTF.
DISPLAY 'SORT SUCCESSFUL'.
MOVE '123' TO VAR7.
DISPLAY 'FIRST VAR7 SENDING :' VAR7.
DISPLAY 'FIRST VAR6 SENDING :' VAR6.
*-------------------------------------------------------------
* USING FUCNTIO LENGTH
*-------------------------------------------------------------
MOVE STRING1 TO STRING2(1:FUNCTION LENGTH(STRING1)).
DISPLAY 'STRING 2 ' STRING2.
*-------------------------------------------------------------
* USING FUCNTIO OF SPECIAL REGISTER
*-------------------------------------------------------------
MOVE STRING1 TO STRING2(1:LENGTH OF STRING1 ).
DISPLAY 'STRING 2 ' STRING2.
STOP RUN.
logic 2
FILE-CONTROL.
SELECT INP ASSIGN TO INF
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD INP
RECORDING MODE IS F.
01 INP-REC.
10 STUDENT-ID PIC 9(3).
10 STUDENT-NAME PIC X(20).
WORKING-STORAGE SECTION.
01 WS-INP-REC.
10 WS-STUDENT-ID PIC 9(3).
10 WS-STUDENT-NAME PIC X(20).
* 01 INX PIC X(3).
01 ARRAY.
05 ARRAY-DEF OCCURS 3 TIMES INDEXED BY INX.
10 STUDENT-ID-TAB PIC 9(3).
10 STUDENT-NAME-TAB PIC X(20).
05 EOF PIC X VALUE 'N'.
01 STRING-A PIC X(30).
01 PRINT-CHAR PIC X(20).
LINKAGE SECTION.
01 CALL-VALUE.
05 CALL-LEN PIC S9(4) COMP.
05 CALL-CHAR PIC X(20).
PROCEDURE DIVISION USING CALL-VALUE.
OPEN INPUT INP.
SET INX TO 1.
READ INP INTO WS-INP-REC.
MOVE WS-INP-REC TO ARRAY-DEF(INX).
* DISPLAY STUDENT-ID.
DISPLAY STUDENT-ID-TAB(INX).
DISPLAY STUDENT-NAME-TAB(INX).
SET INX UP BY 1.
READ INP INTO WS-INP-REC.
MOVE WS-INP-REC TO ARRAY-DEF(INX).
* DISPLAY STUDENT-ID.
DISPLAY STUDENT-ID-TAB(INX).
DISPLAY STUDENT-NAME-TAB(INX).
SET INX UP BY 1.
READ INP INTO WS-INP-REC.
MOVE WS-INP-REC TO ARRAY-DEF(INX).
* DISPLAY STUDENT-ID.
DISPLAY STUDENT-ID-TAB(INX).
DISPLAY STUDENT-NAME-TAB(INX).
CLOSE INP.
DISPLAY 'LENGTH ' CALL-LEN.
DISPLAY 'CALL-CHAR ' CALL-CHAR.
IF CALL-LEN > 0 THEN
MOVE CALL-CHAR(1:CALL-LEN) TO PRINT-CHAR
DISPLAY 'PRINT-CHAR 'PRINT-CHAR
DISPLAY CALL-LEN
END-IF.
ACCEPT STRING-A FROM SYSIN.
DISPLAY 'STRING-A ' STRING-A.
GOBACK.
Is This Answer Correct ? | 0 Yes | 0 No |
How to execute 300 steps in a Job?
I am getting the file from Unix to Mainframes for every 15 minutes. The mainframe job get abended with bad records coming from unix. I recovered that by deleting the bad data. I need permenant solution how to fix the issue? The record is getting characters in in first 9 positions which it should not. Please provide me the solution how to skip the records if it finds the charcters in the first 9 positions. K
How To get the last record in VSAM file in cluster? and How can u get the ksds file records into ur cobol program ? Pls tell me about these two questions.
What is dummy parameter in JCL??
if we give TIME=0 how many sec that job/step
What does a disposition of (NEW,CATLG,DELETE) mean?
Passing a variable parm from JCL to a cobol/db2 program
Is it possible to left uncode disp?
I have 5 steps in my job. say s1, s2, s3, s4, s5 //s1 exec ............. //s2 exec ............ //s3 exec .......... //s4 exec ........ //s5 exec ............... my question is i want to exeute only s2 and s4 steps... please advice me how to do this:
How do you send the output of a COBOL program to a member of a PDS?
Explain about Internal Sort
What is meant by S0C7 system abend code?