![]() |
XSM : eXtended Sort/Merge utility
by Henri Henault |
|
|
Porting MVS JCL SORT to UNIX/Linux/Win using XSM
Challenges:
Solution:When original JCLs are converted with our MVS to UNIX batch converter, sort steps work straight out-of-the-box with no necessary syntax conversion.
Following example shows the SORT FIELDS statement, using exactly the legacy DFSORT SYSIN.
Typical MVS JCL Sort/Merge step://********************************************************************** //* STEP : SORT MERGE INF712 INF713 * //********************************************************************** //INP1234 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //* Two input files, MVS Catalog will find out RECFM and LRECL: //SORTIN DD DSN=PRD123.CLIENT.INF712,DISP=SHR // DD DSN=PRD123.CLIENT.INF713,DISP=SHR //* One output file, we specify RECFM,LRECL: //SORTOUT DD DSN=PRD123.CLIENT.INF714,DISP=(,CATLG,DELETE), // UNIT=SYSDV,SPACE=(CYL,(3,3),RLSE),VOL=SER=B80WKC, // DCB=(RECFM=FB,LRECL=205,BLKSIZE=0) //* Sort keys: //SYSIN DD * SORT FIELDS=(15,1,CH,A, 5,5,CH,A, 10,5,CH,A, 201,4,PD,A) EXCLUDE COND=(30,2,CH,EQ,C'L1',AND, 32,1,CH,EQ,C'1', OR, 30,2,CH,EQ,C'L2',AND, 32,1,CH,EQ,C'2') /* XSM equivalent parameter file for UNIX/Windows:* Two input files: INPFIL PRD123.CLIENT.INF712 INPFIL PRD123.CLIENT.INF713 * One output file: OUTFIL PRD123.CLIENT.INF714 * There is no Catalog on UNIX/Win, so we must specify input and output RECFM,LRECL: RECORD RECFM=F,LRECL=205 * Sort keys, we just use the SYSIN "as is" : SORT FIELDS=(15,1,CH,A, 5,5,CH,A, 10,5,CH,A, 201,4,PD,A) EXCLUDE COND=(30,2,CH,EQ,C'L1',AND, 32,1,CH,EQ,C'1', OR, 30,2,CH,EQ,C'L2',AND, 32,1,CH,EQ,C'2')That's it! XSM handles Binary as well as Packed Decimal in fixed or variable length records. See XSM full syntax.
Then download and go for a free trial!
|
| Contact | Company Info | Site map | Trademarks | Design Stéphane HENAULT © HH&S 1994-2010 | ![]() |