IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Calling DFSORT from Cobol, using OUTFIL statements from IGZS


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Steve Verdier

New User


Joined: 06 Dec 2023
Posts: 3
Location: England

PostPosted: Mon Dec 11, 2023 8:46 pm
Reply with quote

I'm calling SORT from a simple Cobol program, and passing 2 OUTFIL statements via IGZSRTCD, to split the input data into 2 output files.

The SORT statement is:-
Code:
    SORT S01-FILE-SORTED                 
      ON ASCENDING KEY P050-CUSTOMER-ID 
                                         
      USING  I01-BUCKET-DISC-INPUT-FILE 
      GIVING O01-BUCKET-DISC-OUTPUT-FILE
             O02-BUCKET-DISC-OUTPUT-FILE.


The OUTFIL statements are mutually exclusive, being:-

Code:
 OUTFIL FILES=DH,INCLUDE=(14,1,CH,EQ,C'1',OR,14,1,CH,EQ,C'2')
 OUTFIL FILES=DD,OMIT=(14,1,CH,EQ,C'1',OR,14,1,CH,EQ,C'2')   


But DFSORT gives these messages:-
Code:
ICE080I 0 IN MAIN STORAGE SORT                         
ICE055I 0 INSERT 8, DELETE 8                           
ICE054I 0 RECORDS - IN: 0, OUT: 0                       
ICE227I 0 SORTOFDH : DELETED = 0, REPORT = 0, DATA = 0 
ICE228I 0 SORTOFDH : TOTAL IN = 0, TOTAL OUT = 0       
ICE227I 0 SORTOFDD : DELETED = 0, REPORT = 0, DATA = 0 
ICE228I 0 SORTOFDD : TOTAL IN = 0, TOTAL OUT = 0       
ICE174I 0 NO DATA RECORDS FOR AN OUTFIL DATA SET - RC=0
ICE134I 0 NUMBER OF BYTES SORTED: 640                   
ICE253I 0 RECORDS SORTED - PROCESSED: 8, EXPECTED: 20   


I can't use any of the more complex syntaxes, as this code must be able to run on both IBM z/OS and Micro Focus. Apologies if I've broken any formatting rules.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1308
Location: Bamberg, Germany

PostPosted: Mon Dec 11, 2023 8:53 pm
Reply with quote

For Debugging, try SAVE instead of the OMIT, or add a DEBUG statement just for this.
Back to top
View user's profile Send private message
Steve Verdier

New User


Joined: 06 Dec 2023
Posts: 3
Location: England

PostPosted: Tue Dec 12, 2023 2:44 pm
Reply with quote

I ran it with SAVE, and DEBUG, but am none the wiser. Neither output file contains any records.

Interestingly (?) if the output files are directed to SYSOUT, both files contain all input records, sorted into sequence. Presumanly, when directed to datasets, the records are also initially written, but the datasets are closed and then re-opened for output, resulting in empty datasets.

In either case, the messages indicate that DFSORT recognised that there were no records output, despite the use of SAVE.

Code:
1ICE805I 0 JOBNAME: MFISVR94 , STEPNAME: HPP510
 ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL
 ICE201I C RECORD TYPE IS F - DATA STARTS IN POSITION 1
 ICE118I 0 UNKNOWN FILE SIZE - RECOMMEND SPECIFYING FILSZ=EN TO REDUCE RISK OF FAILURE OR DEGRADED PERFORMANCE
 ICE858I 0 LA=1685264, DA=6144, AA=1679120, BA=113, CP=0, TA=161
 ICE859I 0 LB=9840, DB=1000, AB=8840, BB=0, CP=19, RS=32, TB=71
 ICE860I 0 F=NN, P=2, M=N, B=2048
 ICE906I 0 ST=ABOVE,SR=6291456,RC=0
 ICE907I 0 ST=ABOVE,SA=6291440,NF=1,LF=6291440,SF=6291440
 ICE906I 0 ST=BELOW,SR=1024000,RC=0
 ICE907I 0 ST=BELOW,SA=1023984,NF=1,LF=1023984,SF=1023984
 ICE992I 0 RA 0 WR 0 TR 2
 ICE751I 0 C5-NONE   C6-NONE   C7-NONE   C8-I76518 E4-NONE   C9-NONE   E5-I76518 E6-NONE   C4-NONE   E7-NONE
 ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
 ICE000I 0 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R5  - 03:52 ON TUE DEC 12, 2023 -
0          DEBUG NOABEND
           OUTFIL FILES=DH,INCLUDE=(1,7,CH,EQ,C'HEADER1',OR,1,7,CH,EQ,C'TRAILER')
           OUTFIL FILES=DD,SAVE
           SORT FIELDS=(0001,0008,CH,A)
           RECORD TYPE=F,LENGTH=(000080,,)
           END 
 ICE193I 0 ICEAM2 INVOCATION ENVIRONMENT IN EFFECT - ICEAM2 ENVIRONMENT SELECTED
 ICE089I 1 MFISVR94.HPP510  .        , INPUT LRECL = 80, TYPE = F
 ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)
 ICE156I 0 MAIN STORAGE ABOVE 16MB = (6234096,6234096)
 ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256
 ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,MSGDDN=SYSOUT
 ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO   ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=(SYSDA   ,004),ABCODE=MSG
 ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,COBEXIT=COB2,ZSORT=N
 ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=16384,CINV=Y,CFW=Y,DSA=0
 ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N
 ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=2097152,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
 ICE235I 0 OPTIONS: NULLOUT=RC0
 ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y,TUNE=STOR,EXPMAX=MAX    ,EXPOLD=50%    ,EXPRES=10%
 ICE750I 0 DC 0 TC 0 CS DSVVV KSZ 8 VSZ 8
 ICE887I 0 CSES 0,0,0 ES 0,0,0
 ICE886I 0 SYS 0 TSTG 0 FS 0 INIT 0 MAX 0 LEN 0
 ICE752I 0 FSZ=0 RE  IGN=0 C  AVG=80 0  WSP=0 E  DYN=8212 16352
 ICE915I 0 MOFSZ=16,MOSZ=0,MOSYS=519(5),MOSTG=519,MEML=17592186039803(3)
 ICE916I 0 MOFR=0402,MOVR=VV
 ICE996I 0 ESM=265920,ESO=132960,ESR=26592,ESP=4096,ESS=16384,CES=1491712,HSZ=16777216
 ICE997I 0 HWSP=0,HMAX=0,MOMAX=132864,ASV=132960,EQ=I3,HN=1
 ICE898I 0 OMAX=0,NMAX=265920,ENQT=132960,CMAX=16384,HU=99,BUN=16352,MD=NK,M2,DU=83,DR=0,HN=1
 ICE880I 0 QP=5 QA=5 HI=33 LI=29 MI=33 TZ=18272 N1=16384 N2=16384 SZ=5 HN=1
 ICE889I 0 CT=MAX     , SB=3, L=0, D=0000, CCW=1MAM
 ICE901I 0 W 01NP35 03NP35 04NP35 05NP35 02NP31 06NP31
 ICE906I 1 ST=ABOVE,SR=6234096,RC=0
 ICE907I 1 ST=ABOVE,SA=6234080,NF=1,LF=6234080,SF=6234080
 ICE906I 1 ST=BELOW,SR=47896,RC=0
 ICE907I 1 ST=BELOW,SA=39688,NF=1,LF=39688,SF=39688
 ICE231I 0 STORAGE USED FOR OUTFIL : BELOW 16M = 72704, ABOVE 16M = 164864
 ICE855I 0 SORTOFDH : TX=N, R= , L= , B= , BL=3, BR=2, DCT=200, VS=N, RU=X, SB=4
 ICE210I 0 SORTOFDH : BSAM USED, LRECL = 80, BLKSIZE = 80, TYPE = FB
 ICE855I 0 SORTOFDD : TX=N, R= , L= , B= , BL=3, BR=2, DCT=200, VS=N, RU=X, SB=4
 ICE210I 0 SORTOFDD : BSAM USED, LRECL = 80, BLKSIZE = 80, TYPE = FB
 ICE751I 1 DE-NONE   D5-NONE   D9-NONE   CB-NONE   E8-NONE
 ICE999I 0 PWK=4 PSP=8212 SWK=0 SSP=0 TWK=0 TSP=0 RWK=0 RSP=0 AWK=4 AWP=8212
1ICE080I 0 IN MAIN STORAGE SORT
 ICE055I 0 INSERT 8, DELETE 8
 ICE054I 0 RECORDS - IN: 0, OUT: 0
 ICE227I 0 SORTOFDH : DELETED = 0, REPORT = 0, DATA = 0
 ICE228I 0 SORTOFDH : TOTAL IN = 0, TOTAL OUT = 0
 ICE227I 0 SORTOFDD : DELETED = 0, REPORT = 0, DATA = 0
 ICE228I 0 SORTOFDD : TOTAL IN = 0, TOTAL OUT = 0
 ICE174I 0 NO DATA RECORDS FOR AN OUTFIL DATA SET - RC=0
 ICE134I 0 NUMBER OF BYTES SORTED: 640
 ICE253I 0 RECORDS SORTED - PROCESSED: 8, EXPECTED: 0
 ICE165I 0 TOTAL WORK DATA SET TRACKS ALLOCATED: 2760 , TRACKS USED: 0
 ICE199I 0 MEMORY OBJECT USED AS MAIN STORAGE = 0M BYTES
 ICE299I 0 MEMORY OBJECT USED AS WORK STORAGE = 0M BYTES
 ICE399I 0 MEMORY OBJECT USED IN ZSORT PATH = 0M BYTES
 ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES
 ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
 ICE891I 1 6273800 WMAIN, 17656 CMAIN, MAX CALLOC, N SCN, B BA, 0 AZ, 0 BZ, NN QC, 1280 CZ, 0 DZ, 1 PLE
 ICE892I 1 80 RIN  0 BLI  0 BLO  80 RUN  16352 BUN  2965 CPU  00 CVC
 ICE893I 1 0 XIN 5 WIN 68792 GIN NDEN PFP4  B00 CM000 CIX UPTS LMI VS   RUX
 ICE894I 0 1 STR  0 MOR  0 IPB  0 OPB  0 CYL  I   MN
 ICE881I 0 EQ=I3 DX=0 D2=0 D3=5 D4=0 AS=0 SA=0 SB=0 SC=0 HN=1
 ICE885I 0 DAT 00 DSR 0007 BINS 0 BSZ 0 RCP 0 AJC 0 RLC 0 DUNIT 0
 ICE895I 0 155 MUNIT  42 SUNIT  31 OUNIT
 ICE896I 0 0 SET  0 DEXTOT  0 BLK   0 CSZ  10 WE
 ICE804I 1 SORTWK06 EXCP COUNT: 1
 ICE804I 1 SORTWK05 EXCP COUNT: 2
 ICE804I 1 SORTWK04 EXCP COUNT: 2
 ICE804I 1 SORTWK03 EXCP COUNT: 2
 ICE804I 1 SORTWK02 EXCP COUNT: 1
 ICE804I 1 SORTWK01 EXCP COUNT: 2
 ICE899I 0 HSR=0,HSW=0,HRE=0,HWE=0,HRP=0,HWP=0,HWM=0,HNM=1
 ICE267I 0 ZSORT ACCELERATOR PATH NOT USED    RSN=193
 ICE052I 0 END OF DFSORT
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Tue Dec 12, 2023 7:48 pm
Reply with quote

First of all: try running your SORT from batch, to be sure your SORT statements, and your DD statements are OK, and there is no misunderstanding between yourself, and SORT utility.

Next step: move your stuff inside COBOL.
Back to top
View user's profile Send private message
Steve Verdier

New User


Joined: 06 Dec 2023
Posts: 3
Location: England

PostPosted: Tue Dec 12, 2023 8:42 pm
Reply with quote

It works fine from JCL :-

Code:
ICE080I 0 IN MAIN STORAGE SORT                           
ICE055I 0 INSERT 0, DELETE 0                             
ICE054I 0 RECORDS - IN: 8, OUT: 8                       
ICE227I 0 OBKDH    : DELETED = 4, REPORT = 0, DATA = 4   
ICE228I 0 OBKDH    : TOTAL IN = 8, TOTAL OUT = 4         
ICE227I 0 OBKDD    : DELETED = 4, REPORT = 0, DATA = 4   
ICE228I 0 OBKDD    : TOTAL IN = 8, TOTAL OUT = 4         
ICE134I 0 NUMBER OF BYTES SORTED: 640                   


And I could probably use input/output procedures, but that's just a workaround. I guess it's a bug in DFSORT, but I believe that my customer has got the combination (Cobol+SORT+OUTFIL) working, although I'm waiting for confirmation, and whether they are using DFSORT or SYSNCSORT.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Tue Dec 12, 2023 9:48 pm
Reply with quote

Looks strange the difference between
Code:
ICE055I 0 INSERT 0, DELETE 0                             
ICE054I 0 RECORDS - IN: 8, OUT: 8         
and
Code:
ICE055I 0 INSERT 8, DELETE 8
ICE054I 0 RECORDS - IN: 0, OUT: 0


I suggest to compare in details the full SORT logs of both cases. At least different DD-names are used, maybe something else differs?

In this example, absolutely not clear: where INSERT 8, DELETE 8 comes from???

I suspect some mess in used DD names and/or definitions. Maybe unknown defaults in COBOL-SORT interface?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts Compile Sp Cobol base COBOL Programming 1
No new posts SQLCODE=-311 in Cobol SP-DB2. COBOL Programming 2
No new posts Dynamically build sort control statem... SYNCSORT 18
No new posts COBOL 6.4 - User Defined Function nee... COBOL Programming 6
Search our Forums:

Back to Top