I have program P1 which calls file F1 which has 100 records
and following structure
001 ..................
002 ..................
003 ..................
098 ....................
099 ...................
100 ....................
Now I want to read these files and write these records in
file F2 in following manner.
001 ...... 051 .....
002 ...... 052 .....
003 ...... 053 .....
.......... .......
.......... .......
.......... .......
048 ........ 098 ......
049 .......... 099 .......
050 .... 100 ......
Answers were Sorted based on User's Feedback
Answer / ch. ranveer singh
//Aaaaaaaa JOB ,'ADC',NOTIFY=&SYSUID
BY CH . RANVEER SINGH GURJAR
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=WW.W.AHOC.ADC.P1,DISP=SHR
//SORTOF1 DD DSN=WW.W.AHOC.ADC.P2,DISP=SHR
//SORTOF2 DD DSN=WW.W.AHOC.ADC.P3,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FILES=(1,2),SPLITBY=50
/*
//
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / krishnan a
1.first use JCL to sort the file then split the file into
two or read the file first 50 record by using count after
reached 50 then move to one file then remaining 50 move to
other file then read file1 and write by using write para
(PERFORM FILE1-WRITE1) then READ SECOND file then write
second FILE2 record(PERFORM FILE2-WRITE2)into the same
output file.
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / gm
Simple. Read the input file in sequence.
Store the first 50 records in a table.
When you start reading from 51st record,
Build your output record with one half of
the record from the table (record 1) and the
other half from the input that u have read (51)
and write the output record.
Loop thru till end.
| Is This Answer Correct ? | 1 Yes | 2 No |
wht is the diff b/w if and evaluate stmts ?
BY seeing a program how can we say that it is static call or dynamic call
in the TIME parameter we r giving hours r minutes
i have mainprogram and subgram...if i compile mainprogram without stop run..what will u get in compilation time?
how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)
is it possible to pass an SQL query inside a jcl which is inside a cobol program?
I need to compare two VSAM files, both having 'number' as key. If there is a matching record, write the data into another VSAM file. How will it be possible.
What are the different types of condition in cobol and write their forms.
In an EVALUTE statement is the order of the WHEN clauses significant?
How many maximum number of procedures can we write in one COBOL program?
If you were passing a table via linkage, which is preferable - a subscript or an index?
I am sending values a and b with pic x(10) and pic x(10) by using call statement. In linkage section, I am receiving values with pic x(10) and pic x(11). Will my program fail? will it be compile error or run time abend?