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

Explain about REXX

1 Answers  


What is the purpose and meaning of the REGION keyword and what JCL statement is it associated with?

3 Answers   IBM,


how are instream data terminated?

3 Answers   Tech Mahindra,


Suppose I have 5 dataset listed under a single DD name in a catlogued PROC. How can I override one of those 5 dataset (say 3rd dataset)?

5 Answers   Cognizant,


What is a Proc ? why do we go for a Proc ? What are the types of procs?Can we have nesting in Procs ?

9 Answers   Xansa,






How to identify where file is empty or not? How many ways are there to identifying?

3 Answers   CTS,


what is A-MODE and R-MODE?

2 Answers  


How we can code in a jcl to execute a job in a particular time and date without using any job shudular?. (Eg) i want to execute a particular job at 8 am on 01/01/2010.

2 Answers   Target,


what is JCL?

0 Answers  


Can anyone tell me the syntax for printing two files at two different destinations in a single step?

3 Answers  


What are the utility programs in jcl?

0 Answers  


//ERFDS JOB //STEP1 //STEP2 //STEP3...COND=(4,LT) //STEP4 1.CONDITION IN STEP3 REFERS TO WHICH STEP'S RETURN CODE (STEP1 OR STEP2)? 2.IN ABOVE PROGRAM IF CONDITION SATISFIES IN STEP3 WHICH STEPS WILL EXECUTE?? AND WHY? IF CONDITION IN STEP3 SATISFIES

5 Answers   IBM,


Categories