ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  MainFrame  >>  IBM MainFrame  >>  COBOL
 
 


 

 
 COBOL interview questions  COBOL Interview Questions
 JCL interview questions  JCL Interview Questions
 CICS interview questions  CICS Interview Questions
 DB2 interview questions  DB2 Interview Questions
 IMS interview questions  IMS Interview Questions
 IDMS interview questions  IDMS Interview Questions
 Natural interview questions  Natural Interview Questions
 ADABAS interview questions  ADABAS Interview Questions
 REXX interview questions  REXX Interview Questions
 Assembler interview questions  Assembler Interview Questions
 CLIST interview questions  CLIST Interview Questions
 QMF interview questions  QMF Interview Questions
 MVS interview questions  MVS Interview Questions
 OS390 interview questions  OS390 Interview Questions
 OS 2 interview questions  OS 2 Interview Questions
 VSAM interview questions  VSAM Interview Questions
 QSAM interview questions  QSAM Interview Questions
 Sysplex interview questions  Sysplex Interview Questions
 IBM MainFrame AllOther interview questions  IBM MainFrame AllOther Interview Questions
Question
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.
 
 Question Submitted By :: Viks
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
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 ?    0 Yes 1 No
Asmara
 
  Re: 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
# 2
Hi Asmara i think u didnt get my question asking 
for.Actually my requirement is to not only merge all 5 
fields but they shud come in 1 row(2 flds from file 1 and 3 
flds from file 2) into file3(output file)


file1 is having 2 fields
 
field1    field2
123       234


file2 is having 3 fields
field1    field2    field3

456       678       789

output file3
Fld1 fld2 fld1 fld2 fld3
123  234  456  678  789
 
Is This Answer Correct ?    0 Yes 0 No
Viks
 
 
 
  Re: 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
# 3
Quikjob is best for your case. (if your company has this 
mainframe tool. It is a JCL tool similar to a SORT).
 
Is This Answer Correct ?    0 Yes 0 No
Sumanth Toom
 
  Re: 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
# 4
FD FILE1
01 FILE1-REC
	05 FIELD1 PIC X(3)
	05 FIELD2 PIC X(3)

FD FILE2
01 FILE2-REC
	05 FIELD1 PIC X(3)	
	05 FIELD2 PIC X(3)
	05 FIELD3 PIC X(3)

FD FILE3
01 FILE3-REC
	05 FELD1 PIC X(3)
	05 FELD2 PIC X(3)
	05 FELD1 PIC X(3)
	05 FELD2 PIC X(3)
	05 FELD3 PIC X(3)

PROCEDURE DIVISION
oPEN INPUT FILE1
	   FILE2
     OUTPUT FILE3
	
READ FILE1
READ FILE2

WRITE FILE3-REC FROM FILE1-REC,FILE2-REC.

STOP RUN.
 
Is This Answer Correct ?    0 Yes 0 No
Visitor
 
  Re: 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
# 5
i think the last ans will give som error due the same 
varable name is declare in the same level in fd file3.
 
Is This Answer Correct ?    0 Yes 0 No
Shailendra
 
  Re: 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
# 6
Have an output file with 5 fields
Output file layout
field1field2filed3field4field5
MOVE FIELD1 OF FILE1 TO FIELD1 OF OUTPUT
MOVE FIELD2 OF FILE1 TO FIELD2 OF OUTPUT
MOVE FIELD3 OF FILE1 TO FIELD3 OF OUTPUT
MOVE FIELD1 OF FILE1 TO FIELD4 OF OUTPUT
MOVE FIELD2 OF FILE1 TO FIELD5 OF OUTPUT
WRITE OUPUT FILE
 
Is This Answer Correct ?    0 Yes 0 No
Sivakumar Sekharannair
 
  Re: 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
# 7
By using move reference modification it is very simple.
first open 2 input files and 1 output file.read 2 input 
files.write the logic as following.
move filerec1 to filerec3(1:10).
move filerec2 to filerec3(11:10).
write filerec3.
 
Is This Answer Correct ?    0 Yes 0 No
Sruthi
 

 
 
 
Other COBOL Interview Questions
 
  Question Asked @ Answers
 
how to change picture class of copy book variable inside program?  2
What is Comm? IBM1
What are decleratives in COBOL ? Xansa1
ZEROES and SPACES are _______ constants (a) Figurative (b) Numeric (c) Non-numeric (d) Alphabete TCS3
Move Zeroes to I move 5 to j perform para1 varying I from 10 by -2 until I = 0 display j. para1. Add 5 to j. What’ll be the value after execution of display stmt. A) 35 B) 40 C) 30 D) 25 please explain how?  3
What are the differences between COBOL and COBOL II? CSC1
What is "Call by content" and "call by reference"? ADP1
COMPUTE X = A * B - C * D and COMPUTE X = (A * B) - (C * D) (a) Are not the same (b) Are same (c) Syntactically wrong (d) Will yield a run time error TCS1
What are the steps you go through while creating a COBOL program executable?  1
Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this? T-systems7
study the following code 01 A1 05 B PIC 99 05 C PIC X(4) 01 A2 05 B PIC 99V99 05 C PIC A(4) pick out the valid statement from the following a.A1 and A2 can not have sub-ordinates b.A1 and A2 can have the same sub-ordinates but must have same PIC clause c.there is nothing wrong d.A1 and A2 can have same sub-ordinates provided they are not at 01 level TCS2
What do you feel makes a good program?  1
What is the significance of 'above the line' and 'below the line'?  1
period is missing in the cobol program which error we getting Tesco4
What does the IS NUMERIC clause establish ?  1
study the data discriptions and answer the questions given below i)01 ORDER RECORD 05 OUT-HEADER PIC X(50) 05 ITEM-COUNT PIC 99 05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING ON ITEM-COUNT ii)01 NAME-AND-ADDRESS 05 N-AND-A-LINE OCCURES 5 05 LINE-LENGTH PIC P9 05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON LINE-LENGTH iii)01 SALES-LIST 05 SALESMAN-COUNT PIC 99 05 SALES PIC 9(6) OCCURS 1 TO 100 DEPENDING ON SALESMAN-COUNT iv)01 ORDER-RECORD 05 NO-OF-BRANDS PIC 99 05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON NO-OF-BRANDS which of the following is true? a.i) and iii) are valid b.i) and iv) are valid c.i) and iii) are not valid d.all are valid TCS3
given the following: 77 A PIC 9V9 VALUE 9.5 77 B PIC 9 VALUE 9. 77 C PIC V9 VALUE 0.8 77 D PIC 9 77 E PIC 9 77 F PIC 9V999 what are the contenta of D E nad F after the following statements are executed: COMPUTE F ROUNDED=A+C/B MULTIPLY A BY C GIVING E ADD B C A GIVING D ROUNDED a.F=9.589 E=8 D=1 b.F=9.589 E=8 D=9 c.F=9.589 E=7 D=9 d.F=9.589 E=7 D=1 TCS4
OCCURS clause is used in the DATA DIVISION on data names at (a) 01 level (b) 77 level (c) 88 level (d) any level from 02 to 49 TCS8
hai friends ,i have HSBc exam on this sunday,my platform is Mainframe,i have 1 year exp,pls any one send me placement papers of Hsbc and technical questions on mainframe iNautix2
What is report-item?  1
 
For more COBOL Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com