Sunday, July 26, 2009

Creating a table & entering values into that table using rexx

This is a simple rexx code to create & entering values into that table.

/*rexx*/
ADDRESS ISPEXEC
"control errors return"
"libdef isptlib"
"libdef isptabl"

Tdsn = 'AAA.DSN'
TNAME = 'SAMPLE'

"libdef isptlib dataset id('"Tdsn"') uncond"
"libdef isptabl dataset id('"Tdsn"') uncond"

"tbcreate "TNAME" keys(ID) names(NAME)"
"tbclose "TNAME
"tbopen "TNAME

ID = '001'
NAME = 'AGENT1'
"tbadd "TNAME

ID = '002'
NAME = 'AGENT2'
"tbadd "TNAME

"tbclose "TNAME
"libdef isptlib"
"libdef isptabl"

No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory