Monday, March 23, 2009

Using execio to find a empty dataset

This is a simple program to find out the empty dataset.

/*rexx*/
INPUT = "AAA.DSN"
INPUT = STRIP(INPUT)
IF SYSDSN("'"INPUT"'") = "OK" THEN
DO
"ALLOC FI(INDD) DA('"INPUT"') SHR REUSE" "EXECIO * DISKR INDD (FINIS STEM X."
IF X.0 = 0 THEN SAY "DATASET IS EMPTY"
IF X.0 \= 0 THEN SAY "DATASET IS NOT EMPTY"
END
ELSE SAY "INPUT DATASET DOESNOT EXIST"

No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory