Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

i have two file, each file having :

file1 is having 2 fields

field1 field2



file2 is having 3 fields
field1 field2 field3


my req is to make it one file like:

field1 field2 field1 field2 field3

if anyone know please send me syntax, i tried this with
DFSORT but could not succeed.

Answer Posted / asmara

THRU SORTING AND MERGING IT WILL BE POSSIBLE
IF IT ALREADY SORTED MEANS DO THE MERGING OF TWO FILES,
HERE I AM GIVING THE PROGRAM HOW TO STORE ALL THOSE IN ONE
PROGRAM

IDENTIFICATION DIVISION.
PROGRAM-ID. MERGEFILES.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT STUDENTFILE ASSIGN TO "STUDENTS.DAT"
ORGANIZATION IS LINE SEQUENTIAL.
SELECT DEPARTMENTFILE ASSIGN TO "TRANSINS.DAT"
ORGANIZATION IS LINE SEQUENTIAL.
SELECT NEWSTUDENTFILE ASSIGN TO "STUDENTS.NEW"
ORGANIZATION IS LINE SEQUENTIAL.
SELECT WORKFILE ASSIGN TO "WORK.TMP".
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.

FD STUDENTFILE.
01 STUDENTREC PIC X(30). // THIS IS THE STUDENT REC AS FILE1

FD DEPARTMENTFILE.
01 DEPARTMENTREC PIC X(30).// THIS IS THE DEPT. REC AS FILE2

FD NEWSTUDENTFILE.
01 NEWSTUDENTREC PIC X(30).//THIS IS THE FILE3 IN WHICH YOU
ARE GOING TO STORE THE TWO FILE DETAILS

SD WORKFILE.
01 WORKREC.
02 STUDENTIDWF PIC 9(7).
02 FILLEER PIC X(23).

PROCEDURE DIVISION.
/*HERE I AM MERGING THE TWO FILES AND STORING IN
NEWSTUDENTFILE.*/
BEGIN.
MERGE WORKFILE
ON ASCENDING KEY STUDENTIDWF
USING INSERTIONSFILE, STUDENTFILE
GIVING NEWSTUDENTFILE.
STOP RUN.


---IF I AM WRONG INFORM ME. THANKS





Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the utilization of copybook in cobol?

1113


input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

2157


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

1111


What is the difference between next sentence and continue in cobol programing language?

1156


What is the local-storage section?

1100


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17793


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

6451


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1951


Are you comfortable in cobol or jcl?

988


Write a cobol program making use of the redefine clause.

1120


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

3205


What is the usage of comp fields in cobol?

1127


Difference between array and sub-script ?

1603


Name the divisions, which are available in a cobol program?

1167


What is the use of intialize verb?

1178