View previous topic :: View next topic
|
Author |
Message |
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
|
|
My code is working, but it does not save my ISPF table to the right library. These are snippets of my code:
Prepares the library:
Code: |
ISPTLIB = USERID()'.SCRNPNTR.LOG'
IF SYSDSN("'"ISPTLIB"'") = 'OK' THEN
NOP
ELSE DO
ADDRESS TSO
"ALLOC NEW UNIT(SYSDA) SPACE(1,1)",
"DSORG(PS) BLKSIZE(0) LRECL(80) RECFM(F B)",
"CYL DSNTYPE(PDS) DIR(50) REUSE DSNAME('"ISPTLIB"')"
END
ADDRESS ISPEXEC
"LIBDEF ISPTABL DATASET ID('"ISPTLIB"') STKADD"
"LIBDEF ISPTLIB DATASET ID('"ISPTLIB"') STKADD"
ADDRESS TSO
"TRX ADD FI(ISPPLIB) DA('"ISPPLIB"') SHR"
"TRX ADD FI(ISPLLIB) DA('"ISPLLIB"') SHR"
"TRX ADD FI(SYSPROC) DA('"SYSPROC"') SHR"
"TRX ADD FI(ISPTLIB) DA('"ISPTLIB"') SHR" |
Now do some logic and populate a table:
Code: |
ADDRESS ISPEXEC
'TBEND' SCREEN
'TBERASE' SCREEN
'TBCREATE' SCREEN 'KEYS(FLDCNT)',
'NAMES(FLDNME FLDLEN FLDPICI FLDPICO FLDOCC)'
CALL PROCESS_COPYBOOK
ADDRESS ISPEXEC
'TBSAVE' SCREEN 'REPLCOPY LIBRARY(ISPTABL)'
'TBCLOSE' SCREEN
...
PROCESS_COPYBOOK
FLDCNT = FLDCNT + 1
FLDNME = NAME
FLDLEN = LEN
FLDOCC = OCCRNCE
ADDRESS ISPEXEC
'TBADD' SCREEN
RETURN |
And after doing this, my table is saved, but not to the library that is defined in ISPTLIB. When I look at my concatenation in TRX, it is being stored in a library that is concatenated above my library. Any thoughts? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Only one library -- the first allocated to ISPTABL -- can be written to. I recommend that you add appropriate logic to detect and store the existing allocation(s), allocate only your library to ISPTABL, and reverse those steps upon exit. |
|
Back to top |
|
|
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
you can't write to ISPTLIB. It is a concatenation and you can not write to a concatenated set of libraries. I think ISPF tables are written to ISPTABL (ISPPROF for internal tables) and those must not have more than one data set because you can't write to a concatenated dd. LIBDEF just allocates the library to another ddname and ISPF uses that dd in addition to the actual ddname. Try the ISPLIBD command in ISPF to see your libdefs. |
|
Back to top |
|
|
|