MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COBOL program to access dataset values

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Sandhya.duvvuri
Beginner


Joined: 30 Dec 2003
Posts: 1
Topics: 1
Location: India

PostPosted: Tue Dec 30, 2003 7:03 am    Post subject: COBOL program to access dataset values Reply with quote

Hi,

I am developing a COBOL program to perform a search on a PDS. This is something that I cannot do using 3.14.
I was able to use LMINIT, LMOPEN, LMMLIST, LMFFIND etc calls to ISPF successfully.

But, I am unable to view the contents of the dataset thru LMGET. The return-code is 0 though. I am not aware of the method by which I could 'connect' the ISPF returned variables in the program to COBOL as it is done for any Assembler calls.

My code is:
MOVE 250 TO ISPF-BIG-BUFLEN.
MOVE SPACES TO ISPF-BIG-BUFLIST.
MOVE "LMGET DATAID(&MYPDS)" TO ISPF-BIG-BUF(1).
MOVE "MODE(INVAR)" TO ISPF-BIG-BUF(2).
MOVE "DATALOC(LOCVAR)" TO ISPF-BIG-BUF(3).
MOVE "DATALEN(LENVAR)" TO ISPF-BIG-BUF(4).
MOVE "MAXLEN(80)" TO ISPF-BIG-BUF(5).
CALL "ISPEXEC" USING ISPF-BIG-BUFLEN ISPF-BIG-BUFLIST.

When I display LOCVAR, LENVAR they are empty. So, I understand that there is some other way by which I am expected to read the contents of the dataset.

Please advise.

Thanks,
Sandhya
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Dec 30, 2003 8:18 am    Post subject: Reply with quote

Sandhya,

I would rather flatten the PDS into a sequential file using IEBPTPCH utility and then read the data. This method is very easy and easier to maintain.

Code:

//STEP01   EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*                                               
//SYSUT1   DD DSN=INPUT.PDS,         
//            DISP=SHR                         
//SYSUT2   DD DSN=FLATTENED PDS INTO SEQ FILE,                   
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,         
//            SPACE=(CYL,(X,Y),RLSE),       
//            DCB=(RECFM=FB,LRECL=81,BLKSIZE=0)
//SYSIN    DD *                               
  PUNCH TYPORG=PO                             
/*                           


The above JCl will flatten the PDS into a sequential with a membername as a header.

Hope this helps...

cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Tue Dec 30, 2003 9:04 am    Post subject: Reply with quote

Try to VGET the ISPF system variables ZERRLM, ZERRSM, ZERRMSG.

O.
________
medical marijuana seeds
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group