I'm trying to invoke DFSORT from Assembler.
So I read DFSORT Application Programming Guide (ice1ca50) and I wrote this code
ASMSRCT2 CSECT
INITL 12,EQU=R BASE REG = 12, R15 = 15
OPEN_FIC EQU *
OPEN (SORTIN,(INPUT))
OPEN (SORTOUT,(OUTPUT))
LA R1,PARLST LOAD ADDR OF PARAM POINTER IN R1
LINK EP=SORT
ENDFIC CLOSE SORTIN
CLOSE SORTOUT
RCNTL RC=0
* WORKING STORAGE
* EXTENDED PARAMETR LIST
PARLST DC A(CTLST) ADDRESS OF CONTROL STATEMENTS
PL2 DC A(0) ADDRESS OF E15 ROUTINE
PL3 DC A(0) ADDRESS OF E35 ROUTINE
PL4 DS A USER EXIT ADDRESS CONSTANT
PL5 DC F'-1' INDICATE END OF LIST
CTLST DS 0H CONTROL STATEMENTS AREA
DC AL2(CTL2-CTL1) LENGTH OF CHARACTER STRING
CTL1 DC C' SORT FIELDS=(1,4,CH,A)'
CTL2 EQU *
* FILE DCB
SORTIN DCB DDNAME=SORTIN,DSORG=PS,MACRF=(GL) EODAD=ENDFIC
SORTOUT DCB DDNAME=SORTOUT,DSORG=PS,MACRF=(PM)
*
END ASMSRCT2
INITL 12,EQU=R BASE REG = 12, R15 = 15
OPEN_FIC EQU *
OPEN (SORTIN,(INPUT))
OPEN (SORTOUT,(OUTPUT))
LA R1,PARLST LOAD ADDR OF PARAM POINTER IN R1
LINK EP=SORT
ENDFIC CLOSE SORTIN
CLOSE SORTOUT
RCNTL RC=0
* WORKING STORAGE
* EXTENDED PARAMETR LIST
PARLST DC A(CTLST) ADDRESS OF CONTROL STATEMENTS
PL2 DC A(0) ADDRESS OF E15 ROUTINE
PL3 DC A(0) ADDRESS OF E35 ROUTINE
PL4 DS A USER EXIT ADDRESS CONSTANT
PL5 DC F'-1' INDICATE END OF LIST
CTLST DS 0H CONTROL STATEMENTS AREA
DC AL2(CTL2-CTL1) LENGTH OF CHARACTER STRING
CTL1 DC C' SORT FIELDS=(1,4,CH,A)'
CTL2 EQU *
* FILE DCB
SORTIN DCB DDNAME=SORTIN,DSORG=PS,MACRF=(GL) EODAD=ENDFIC
SORTOUT DCB DDNAME=SORTOUT,DSORG=PS,MACRF=(PM)
*
END ASMSRCT2
I get the following sysout
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 14:17 ON TUE J
SORT FIELDS=(1,4,CH,A)
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K51707 C6-K51707 C7-K54603 C8-K51707 E4-K51707 C9-BASE E5-K55337
ICE193I 0 ICEAM2 INVOCATION ENVIRONMENT IN EFFECT - ICEAM2 ENVIRONMENT SELECTED
ICE252I 1 PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS
ICE088I 1 APIASMT2.APIASMT2. , INPUT LRECL = 300, BLKSIZE = 27900, TYPE
ICE093I 0 MAIN STORAGE = (MAX,4194304,4194304)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (4136944,4136944)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y
ICE128I 0 OPTIONS: SIZE=4194304,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT
ICE131I 0 OPTIONS: TMAXLIM=4194304,ARESALL=0,ARESINV=0,OVERRGN=16384,CINV=Y,CFW
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXIT
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAM
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTOUT
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN
ICE750I 0 DC 27900 TC 0 CS DSVVV KSZ 4 VSZ 4
ICE752I 0 FSZ=93 RC IGN=0 E AVG=300 0 WSP=37 C DYN=0 0
ICE751I 1 DE-K50430 D5-BASE D9-BASE E8-K51707
ICE090I 0 OUTPUT LRECL = 300, BLKSIZE = 27900, TYPE = FB
ICE080I 0 IN MAIN STORAGE SORT
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 17, OUT: 17
ICE134I 0 NUMBER OF BYTES SORTED: 5100
ICE253I 0 RECORDS SORTED - PROCESSED: 17, EXPECTED: 93
ICE199I 0 MEMORY OBJECT STORAGE USED = 0M BYTES
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
ICE052I 0 END OF DFSORT
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 14:17 ON TUE J
SORT FIELDS=(1,4,CH,A)
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K51707 C6-K51707 C7-K54603 C8-K51707 E4-K51707 C9-BASE E5-K55337
ICE193I 0 ICEAM2 INVOCATION ENVIRONMENT IN EFFECT - ICEAM2 ENVIRONMENT SELECTED
ICE252I 1 PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS
ICE088I 1 APIASMT2.APIASMT2. , INPUT LRECL = 300, BLKSIZE = 27900, TYPE
ICE093I 0 MAIN STORAGE = (MAX,4194304,4194304)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (4136944,4136944)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y
ICE128I 0 OPTIONS: SIZE=4194304,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT
ICE131I 0 OPTIONS: TMAXLIM=4194304,ARESALL=0,ARESINV=0,OVERRGN=16384,CINV=Y,CFW
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXIT
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAM
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTOUT
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN
ICE750I 0 DC 27900 TC 0 CS DSVVV KSZ 4 VSZ 4
ICE752I 0 FSZ=93 RC IGN=0 E AVG=300 0 WSP=37 C DYN=0 0
ICE751I 1 DE-K50430 D5-BASE D9-BASE E8-K51707
ICE090I 0 OUTPUT LRECL = 300, BLKSIZE = 27900, TYPE = FB
ICE080I 0 IN MAIN STORAGE SORT
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 17, OUT: 17
ICE134I 0 NUMBER OF BYTES SORTED: 5100
ICE253I 0 RECORDS SORTED - PROCESSED: 17, EXPECTED: 93
ICE199I 0 MEMORY OBJECT STORAGE USED = 0M BYTES
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
ICE052I 0 END OF DFSORT
According to this SYSOUT, the SORTIN file seems to be read normally but i end up with an empty SORTOUT file
after having run this JCL
//APIASMT2 EXEC PGM=APIASMT2
//STEPLIB DD DISP=SHR,DSN=EAPICH.AGRR.LOAD
//SORTIN DD DISP=SHR,DSN=EAPICH.TD.FB300
//SORTOUT DD DISP=(,CATLG),DSN=EAPICH.TD.OUT,
// RECFM=FB,LRECL=300,AVGREC=M,SPACE=(1,(1,1),RLSE)
//SYSOUT DD SYSOUT=*
//STEPLIB DD DISP=SHR,DSN=EAPICH.AGRR.LOAD
//SORTIN DD DISP=SHR,DSN=EAPICH.TD.FB300
//SORTOUT DD DISP=(,CATLG),DSN=EAPICH.TD.OUT,
// RECFM=FB,LRECL=300,AVGREC=M,SPACE=(1,(1,1),RLSE)
//SYSOUT DD SYSOUT=*
I'm actually reading MVS Programming : Assembler Services Reference , volume 2 (IAR - XCT) ( iea2a9a0) to look further
on the Link macro, I may be missing something here but If anyone has an idea ...