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
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 |
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 |
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 |
How much space OS allocates when you create a PS or PDS?
Whats error code s222?
What are the utility programs in jcl?
I have 5 generations in my GDG. How do I code in the JCL to consider all the 5 versions of the GDG ?
Suppose a proc step has a DD statement like //ABC DD DSN=TEST.FILE1,DISP=SHR DSN=TEST.FILE2,DISP=SHR and the above DD name is overridden from the JCL as given below //procstepname.ABC DD DSN=TEST.FILE3 - Will the DD statement now have just TEST.FILE3 or it will be TEST.FILE3 and TEST.FILE2? Suppose if it is overridden twice like //procstepname.ABC DD DSN=TEST.FILE3 //procstepname.ABC DD DSN=TEST.FILE4 Will this give a JCL error? If not, what will be final output?
if my GDG limit has been kept as 50 and if am trying to put 60 records.what would happen. will there be any abend for this scenario
How jcl is used for testing batch programs?
suppose i have 10 job steps and i want to execute only step 6.How to write?
What is the motivation behind coding class parameter in job statement?
How do you create a temporary dataset?
i have a jcl calling proc which has 10 steps, i want to execute from step5 to step10, where can i code RESTART and COND parameter?
01 A. 10 B pic X(10). move spaces to A. move spaces to B. output in A & B