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
i want to store 20 digits . how will u do it in cobol ?
How does jcl act on code(if you take a cobol program)?
How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.
Explain the purpose of dd dummy statement?
What do you understand by the term “keyword” with respect to jcl and what is the opposite of the term?
a dd statement has 2 types of parameters. Name them?
Is there any command to check wether the ps file is in sorted order?
Suppose I have a program in cobol name ”careerride” and want to execute the program by jcl. Specify the process?
what is SOC4 error?
Name the parameters which can be used to limit the number of records written to a sysout dataset?
What is the use of symbol // in jcl?
How can the attributes of one sms dataset be copied to another dataset?
What is the function of dd disp parameter?
How dummy is used in jcl?
What is Cataloged Procedures?