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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the use of IEBGENER utility?

891


When space is allocated for an output dataset, what units can be used?

992


What are the utility programs in jcl?

869


Is automatic restart possible in jcl?

943


hello friends ,i have exam in Hsbc,pls any on send me placement papers and technical questions on mainframes,thank u

1901


Explain how can a stopped job be started again?

862


Suppose I have five jobs to do. But I want to hold one?

863


in a jcl, a large volume dataset is loaded to a table using bmcload in step1 and an image copy of the loaded table is taken using bmccopy in step2. Step2 abends because the image copy dataset cannot hold the volume of the table. How can this be rectified?

1003


how you can access an uncataloged dataset in a JCL?

876


When The Define Jcl Is Not Available, How Can You Get Information About A Vsam File's Organisation ?

991


What do you know about jcl?

856


How to find the UNIT and VOLUME of a (a) KEPT (b) UNCATALOGED and (c) CATALOGED dataset - using (i) JCL and using (ii) ISPF ?

2421


what is DSN in JCL and what are the parameters to declare the DSN?

966


a set statement is used to define commonly used symbolic across job steps or procedures. It initializes the previous values in the symbolic names. It has to be defined before the first use of the symbolic names in the jcl. State whether true or false?

826


what are the types of abends that occur on job failure? And explain the possible causes of these

1335