If a field is declared as a comp-3 field and if we want to
sort a dataset based on this field, then how will the sort
card be???
e.g- if we want to sort by a field which is defined as a
PIC X(5) then we will mention - sort fields=(1,5,ch,a).
Likewise if a field is defined as PIC S9(10)COMP-3 then in
this case how will the sort field be defined (because in
this case a sign is also involved)???
Answer Posted / muttiah
Let's discuss what are all formats we have in sort
X/A - CH
Comp - BI
Comp-3- PD
9 - ZD/CH
So, Here we need to calculate how many bytes does the field
S9(10)comp-3 occupies.
10/2 + 1 = 5 + 1 = 6 bytes
Say field start's @ position 10then the sort command would
be like this..
Sort fields=(10,6,PD,A/D)
Hope this clarifies
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
which parameter is used to check the syntax of a jcl without executing it?
What are s0c1, s0c4, s0c5, s0c7 and socb?
How can the attributes of one sms dataset be copied to another dataset?
Explain the function of dd disp parameter?
What is the purpose of disp parameter?
I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?
what are the types of abends that occur on job failure? And explain the possible causes of these
what is the purpose of coding class parameter in job statement?
How jcl work to handle various input output file operations?
what sort card you will use to copy the data from one dataset to another dataset?
what is JCL?
Mention the types of job control statements?
Explain about ISPF/TSO Commands
i want to store 20 digits . how will u do it in cobol ?
What are some jcl statements that are not allowed in procedures?