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

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:

4 Answers   ITC Infotech, TCS,


Min no of member?s (PDS) in one directory block?

10 Answers  


Please explain with syntax and an example, the Inrec fields and Outrec build in sort.

4 Answers   CTS, TCS,


what is JCL?

0 Answers  


What is a GDG

4 Answers   IBM,


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.

1 Answers   Cap Gemini,


what is force complete

2 Answers   IBM,


What is S322 abend ?

5 Answers  


how would you create a temporary dataset? And where will you use them?

0 Answers  


how to compress the data set

8 Answers   Keane India Ltd,


If the proc stepname is excluded while overriding the COND, TIME, REGION and PARM parameters while calling the proc, will the override only apply to the first step in the proc or all the steps for all the above parameters?

2 Answers  


what is the difference between static call and dynamic call?

1 Answers  


Categories