Sunday, March 29, 2009

How to check whether the dataset is empty in rexx..

using a macro we can check whether the dataset is empty or not.
this is the main program calling the macro CHKSZ.

/*REXX*/
ADDRESS ISPEXEC "VIEW DATASET ('aaa.dataset')"
"MACRO(CHKSZ)"
ADDRESS ISPEXEC "VGET (SZ1) PROFILE"
IF SZ1 = 0
THEN SAY "EMPTY DATASET"
ELSE SAY "NONEMPTY DATASET" EXIT


MACRO(CHKSZ):
/*REXX*/
ADDRESS ISPEXEC "ISREDIT MACRO"
"ISREDIT (SZ1) = LINENUM .ZL"
ADDRESS ISPEXEC "VPUT (SZ1) PROFILE" "ISREDIT CANCEL"

No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory