IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Trouble saving to the right ISPTLIB dataset


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
valyk

Active User


Joined: 16 Apr 2008
Posts: 104
Location: South Carolina

PostPosted: Fri Jan 15, 2010 2:20 am
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Jan 15, 2010 2:45 am
Reply with quote

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
View user's profile Send private message
valyk

Active User


Joined: 16 Apr 2008
Posts: 104
Location: South Carolina

PostPosted: Fri Jan 15, 2010 2:55 am
Reply with quote

I was under the impression that

Code:
  ADDRESS ISPEXEC
  "LIBDEF ISPTABL DATASET ID('"ISPTLIB"') STKADD"
  "LIBDEF ISPTLIB DATASET ID('"ISPTLIB"') STKADD"


Would add the library to the top of the concatenation. Does it not?

http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.f54sg00/zampq6.htm
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Fri Jan 15, 2010 6:27 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top