/* Some information in this structure is only avialable if
the jcl provides the DCB parameter or the associated
dataset is open
*/
DEFINE STRUCTURE
1 tDSInfo
, 2 DD CHAR(8) /* DD Name from JCL */
, 2 DSN CHAR(44) /* Datasetname */
, 2 MEMBER CHAR(8) /* Membername */
, 2 DISP CHAR(3) /* Disposition */
, 2 DSORG CHAR(2) /* Datasetorganisation */
, 2 RECFM CHAR(3) /* Recordformat */
, 2 LRECL BIN FIXED(15) /* Logical Recordlength */
, 2 RESERVED CHAR(442) /* For future use */
;
MyCallback:
PROC(pDSInfo,pUserData) RETURNS(BIT(1));
DCL pDSInfo PTR ;
DCL pUSerData PTR ;
DCL 1 DSInfo TYPE tDSInfo BASED(pDSInfo) ;
PUT SKIP EDIT('DSInfo.DD = ' || DSInfo.DD ) (A);
PUT SKIP EDIT('DSInfo.DSN = ' || DSInfo.DSN ) (A);
PUT SKIP EDIT('DSInfo.Member = ' || DSInfo.Member ) (A);
PUT SKIP EDIT('DSInfo.Disp = ' || DSInfo.Disp ) (A);
PUT SKIP EDIT('DSInfo.DSORG = ' || DSInfo.DSORG ) (A);
PUT SKIP EDIT('DSInfo.RECFM = ' || DSInfo.RECFM ) (A);
PUT SKIP EDIT('DSInfo.LRECL = ' || CHAR(DSInfo.LRECL )) (A);
PUT SKIP EDIT('')(A);
PUT SKIP EDIT('')(A);
RETURN('1'B) ; /* Continue Processing */
END;
CALL DSInfo(MyCallback,NULL());
DSInfo:
/* Loops over the MVS Control blocks to get information
for all DD names associated with the current job.
For each DD Name the filenames and some other
data is fetched from then JFCB (Job File
Control Block).
A callback function is invoked for each file.
The callbackfunction is passed from the calling module.
*/
PROC(pEntry,pUserdata);
DCL pEntry ENTRY
( PTR /* Data for each DDName / Dataset */
, PTR /* Userdata */
) RETURNS(BIT(1)) VARIABLE ;
DCL pUserData PTR ; /* any data passed from the calling modul
an routed to the callback function */
When I executed this program in a jobclass SWA=BELOW, it is fine.
When I ran the program in a jobclass SWA=ABOVE, the program did not give me back the correct SVAB.
As an example
Before starting the SAWREQ routine, display of SVAB is ‘00006F’x for the first file, “0000EF”x for the second, ‘00011F’x for the third, etc With this value the loop
Code:
DO WHILE(SVAB > 65536);
is never activated and the value of SVAB returned is
Code:
SVAB = SVAB +1 +16 +l_QMAT
which is decimal 2136813696 ( 111 + 1 + 16 + 2136813568 ) which seems to be not correct because they are junk characters and not the DSN, the DD name, etc.