Suppose I have a file with three fields with data in the
following format
1. empid - S9(4) COMP
2. empname - X(20)
3. empsal - S9(5)V(2) COMP-3
If I view this file, it will not be in a readable format.
How to display the empid and empsal fields in a readable
format without using COBOL program? What kind of SORT card
will have to be coded?

Answers were Sorted based on User's Feedback



Suppose I have a file with three fields with data in the following format 1. empid - S9(4) COMP ..

Answer / bharathi

We can use a SORT utility in JCL. In the SYSIN DD statement, we need to use the OUTREC FIELDS in the below format,

//SYSIN DD *
SORT FIELDS = COPY
OUTREC FIELDS =(1,4,BI,TO=ZD,
5,20,
21,4,PD,M4)
/*

NOTE - Please refer the below link (Chapter 5) for reformatting records using SORT.
http://publibz.boulder.ibm.com/epubs/pdf/ice1cg30.pdf

Is This Answer Correct ?    7 Yes 0 No

Suppose I have a file with three fields with data in the following format 1. empid - S9(4) COMP ..

Answer / santhosh

That answer was correct. Except that the byte position for the first COMP field will be 2. Not 4. It was a great answer.

Is This Answer Correct ?    2 Yes 0 No

Suppose I have a file with three fields with data in the following format 1. empid - S9(4) COMP ..

Answer / zos13

One quick response :

To read Emp-sal (Comp-3 field), please use HEX ON.
I am not sure for emp-id, binary. Please try and let everyOne know here.
Thnx

Garry.

Is This Answer Correct ?    0 Yes 0 No

Suppose I have a file with three fields with data in the following format 1. empid - S9(4) COMP ..

Answer / zos13

You may use EDIT Mask !!!

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

State the uses of syspring, sysin, sort fields, sum fields and dummy.

0 Answers  


what is the purpose of coding notify parameter in job statement?

0 Answers   IBM,


what is the use of temporary files?

5 Answers   Hexaware,


How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?

0 Answers  


i) Difference between ps, esds, ii) Difference between lrecl, blksize among PS, PDS issues? i.e in jcl at dcb

2 Answers  






I have 5 steps in my jcl ,I need to execute first three steps and then 2nd step again ,4th and 5th steps if rc of 2nd step is zero

1 Answers   ABC,


What do you feel makes a good program?

1 Answers  


What is concatenating?

0 Answers  


how will be submit 1 jcl by other jcl? means that how 'll submit one job by other job??

3 Answers   Steria,


What is the meaning of keyword in JCL? What is its opposite?

1 Answers  


what is JCLLIB and PROCLIB in jcl and their syntax

3 Answers   IBM,


Can we DELETE all the Generations of a GDG at once, WITHOUT deleting the GDG itself ?

7 Answers   IBM,


Categories