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 |
There are 5 steps in a Job. How to bypass the first step by making use of only COND Parameter and not using any Restart and IF/THEN/ELSE parameter?
Which dd parameters are required?
there are 10 steps in jcl how to execute the steps from step2 to step8 only
I've one sequential file, that file size is LREC=100 (File contain Records like 1 to 100). Now I was increase the file size is LREC=102. My question is I want insert 00 (Two Zeros) in to the new file (That output file looks like : 00123 up to 100). How will write the SORT card in JCL. Please let me know.
JCL Example: // //RUNJCL JOB CLASS=5,MSGCLASS=6,NOTIFY=&SYSUID //STEP01 EXEC PGM=IEFBR14 // .. .. If this JCL will run or it'll throw the ERROR?
how can i use the parameters decalred in main pgm in sub pgm
How to skip first step of a job? Can we use COND on the first step?
i want to store 20 digits . how will u do it in cobol ?
Why we us SYSTSIN DD with IKJEFT01 (TSO Utility) to execute a COBOL DB2 program? Why can't we use SYSIN DD?
What are three parameters you can specify on Job statement as well as on exec stmt ?
What parameter directs the output of the job log dataset?
Explain about LMINIT - generate a data ID for a data set