Author: Sam Dodgers
Posted: Wed Jul 27, 2016 4:37 pm (GMT 5.5)
That's exactly what I am doing.
See my utility's sample/testing JCL:
INFILE01 has LRECL=137, the others have LRECL=80. All are FB.
My whole problem is making the OUTFILE LRECL=137 and RECFM=FB (or whatever they're found to be during program's runtime) without specifying that in the JCL (the idea being that the customer doesn't know the record lengths of all his INFILEs and the program would auto-detect that for him).
To avoid further misunderstandings, let me post relevant portions of the function in question (note there are redundant debug/hacking variables):
Posted: Wed Jul 27, 2016 4:37 pm (GMT 5.5)
That's exactly what I am doing.
See my utility's sample/testing JCL:
Code: |
//CATLRSN EXEC PGM=CATLRSN3 //STEPLIB DD DISP=SHR,DSN=xxx.xxx.LINKLIB //SYSPRINT DD SYSOUT=A //LOGFILE DD SYSOUT=A //OUTFILE DD DISP=(,CATLG),DSN=&OUTFILE,SPACE=(TRK,(2,4)) //INFILE01 DD DISP=SHR,DSN=xxx.xxx.SYSOUTS(D130703A) //INFILE02 DD DISP=SHR,DSN=xxx.xxx.JCL(CONDEXER) //INFILE03 DD DISP=SHR,DSN=xxx.xxx.TC11.xxx.GLDN#RPT |
INFILE01 has LRECL=137, the others have LRECL=80. All are FB.
My whole problem is making the OUTFILE LRECL=137 and RECFM=FB (or whatever they're found to be during program's runtime) without specifying that in the JCL (the idea being that the customer doesn't know the record lengths of all his INFILEs and the program would auto-detect that for him).
To avoid further misunderstandings, let me post relevant portions of the function in question (note there are redundant debug/hacking variables):
Code: |
CPINOUT: PROC($maxFiles,$maxLrecl,$outRecFm,$outBlksz); /****************************************************************/ /* CPINOUT procedure: */ /* - input: total # of INFILE DDs, LRECL of the longes INFILE, */ /* desired RecFm of the OUTFILE, desired BlockSize of */ /* the OUTFILE */ /* */ /* - purpose: procedure allocates OUTFILE with the same LRECL */ /* as the longest INFILE's LRECL, then copies every */ /* INFILE dataset's content to the OUTFILE dataset, */ /* concatenating all the INFILE datasets in OUTFILE */ /* */ /****************************************************************/ dcl $maxLrecl FIXED(7,0); dcl $currLrecl FIXED(7,0); dcl $padLrecl fixed(7,0) init(0); dcl $maxFiles fixed(3); dcl $curDsnNr fixed(3); dcl $outRecFm char(4) var; /* TODO */ dcl $outBlksz fixed(9); /* TODO */ dcl $currFi file record; dcl $outFiFB file record ENV(FB BLKSIZE(0)); DCL $outFiVB FILE RECORD ENV(VB BLKSIZE(0)); DCL $outFile FILE record; dcl $fileTitl char(9) var; dcl $tempVar char($maxLrecl) var; dcl $tempFix char($maxLrecl); dcl not_eof bit(1) init('1'b); (...) <OUT OF IDEAS ON HOW TO OPEN $OUTFILE or $OUTFIFB WITH $MAXLRECL AND $OUTRECFM HERE> (...) DO $curDsnNr = 1 to $maxFiles by 1; $fileTitl = 'INFILE'||padif10(trim($curDsnNr)); call logstr('Reading '||$fileTitl||' to concatenate'); open file($currFi) title($fileTitl) input; ON ENDFILE($currFi) NOT_EOF='0'B; (...) read file($currFi) into($tempFix); DO WHILE(NOT_EOF); write file($outFiFB) from($tempFix); read file($currFi) into($tempFix); END; /* end looping through all $currFi lines */ close file($currFi); NOT_EOF='1'B; END; |