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
What are steplib and joblib?
I have mainpgm(abc) this is the only cobol pgm(non-db2).And this pgm calling subpgm name "acd" this also only cobol(non- Db)and this pgm calling some other subpgm this pgm has cobol-db2 pgm. 1) IF you calling static mode how to run and how to compile? 2) IF you calling dynamic mode how to run and how to compile? plz suggestion me.
Explain how can the submitting users racf authority be overridden in a job stream?
how to do automated restart when a job abends?
What are the jcl procedures?
what sort card you will use to copy the data from one dataset to another dataset?
How to submit jcl through a cobol program?
how you can access an uncataloged dataset in a JCL?
Is condition checking possible in jcl? If yes, how?
Define concatenating?
How do you access an uncatalogued dataset in a jcl?
When space is allocated for an output dataset, what units can be used?
What is NOTCAT ?
How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.
How can an in-stream dataset be terminated?