How do you define a sort file in JCL that runs the COBOL
program?
Answers were Sorted based on User's Feedback
Answer / shinoy sansilavose
Suppose if you want to sort a file TEST.OUTPUT.FILE which
is the output of your COBOL program then you can do the
following coding in JCL,
//SORTIN DD DSN=TEST.OUTPUT.FILE,DISP=SHR
//SORTOUT DD DSN=TEST.OUTPUT.SORT.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(50,50)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
Now the sorted file TEST.OUTPUT.SORT.FILE will be sorted
based on the field starting from 1 to 5 specified in the
input for SORT.
Is This Answer Correct ? | 30 Yes | 7 No |
Answer / nk
//STEP1 EXEC PGM=MYSORTPGM
//INFILE DD DSN=MY.UNSORTED.FILE,DISP=SHR
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(100,20))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(100,20))
//OUTFILE DD DSN=MY.SORTED.FILE,
// DISP=(,CATLG,DELETE),
// UNIT=TEST,SPACE=(CYL,(100,10),RLSE),
// DCB=(DSCB.FB,LRECL=500)
SELECT SORTWK01-FILE ASSIGN TO SORTWK01.
SD SORTWK01-FILE
etc.
Is This Answer Correct ? | 15 Yes | 11 No |
Answer / rik
YOU HAVE TO SIMPLY WRITE THE FOLLOWING CODE IN YOUR JCL :
//STEP1 EXEC PGM=SUPERSRT
//SORTIN DD DSN=TEST001.INFILE,DISP=SHR
//SORTOUT DD DSN=TEST001.SORTED,DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
// UNIT=WORK,SPACE=(TRK,5,2),RLSE)
//SYSIN DD *
SORT FIELDS=(16,05,ZD,A)
/*
THE CONTAINT OF THE TEST001.INFILE WILL BE COPPIED TO
TEST001.SORTED FILE AND THIS TEST001.SORTED FILE WILL BE
SORTED IN ASCENDING ORDER OF THE CONTAINT OF FIELD POSITION
16 TO 20..
Is This Answer Correct ? | 8 Yes | 5 No |
Answer / priya
Hi,
I want to sort the file in run jcl and i need to get that
sorted file in cobol program there in select statement what
dd name i should mention?
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / savemeenachilar
//STEP1 EXEC
PGM=SORT
//SORTIN DD
DSN=XMMD01.DEV3.REPORT6.LIST,DISP=SHR
//SORTOUT DD
DSN=AMMDPM1.DEV3.SAMPLE.SRTOUT1,
// DISP=
(NEW,CATLG,DELETE),
//
UNIT=SYSDA,
//
MGMTCLAS=DEVL,
// SPACE=(CYL,
(1,10),RLSE),
// DCB=
(RECFM=FB,LRECL=133)
//SYSIN DD
*
SORT FIELDS=
(29,8,CH,A)
SUM
FIELDS=NONE
INCLUDE COND=
(2,1,CH,EQ,C'B',AND,
(113,1,CH,EQ,C'Y',OR,113,1,CH,EQ,C'N'))
/*
//SYSOUT DD
SYSOUT=*
/*
Is This Answer Correct ? | 4 Yes | 5 No |
Answer / ashok
JCL is a dying language man !!
Please indulge in some Emerging Technologies like
PL/I .......
Is This Answer Correct ? | 8 Yes | 41 No |
db2 variable decimal(15,2) what is the equalent size of cobol variable
given the following: 77 A PIC 9V9 VALUE 9.5 77 B PIC 9 VALUE 9. 77 C PIC V9 VALUE 0.8 77 D PIC 9 77 E PIC 9 77 F PIC 9V999 what are the contenta of D E nad F after the following statements are executed: COMPUTE F ROUNDED=A+C/B MULTIPLY A BY C GIVING E ADD B C A GIVING D ROUNDED a.F=9.589 E=8 D=1 b.F=9.589 E=8 D=9 c.F=9.589 E=7 D=9 d.F=9.589 E=7 D=1
in how many mode we can open a file ?
If I want to increase the Limit in GDG. What should I do?
Explain Restart Logic in Cobol?
We have 3 programms A,B,C.In the middle of the program A the controls goes to program B and in the middle of the program B control wants to go program C,after completion of program C again control comes to program B and again after completion of program B control comes to program A.How the process will takes and what are the controls we use for that process.If it is possible anybody of you explain with example?
How is sign stored in Packed Decimal fields and Zoned Decimal fields?
how many bytes does s9(7)COMP-3 field occupies?
how do you reference the rrds file formats from cobol programs
What are declaratives and what are their uses in cobol?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
Consider the below example call a-test1. -- -- -- a-test1. if a=b perform a-test through a-exit next sentence else if b=c perform c-test through c-exit. if a=d perform d-test through d-exit. a-test. -- -- a-exit. exit. can u tell me what will happen if a=b after looping into a-exit will the control go back to a- test1. will the condition a=d be checked???