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 

KSDS readingin PLI

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
kris_madras
Beginner


Joined: 07 Apr 2004
Posts: 41
Topics: 30

PostPosted: Wed Apr 07, 2004 9:49 am    Post subject: KSDS readingin PLI Reply with quote

Hi all,
I am a new buddy to PLI. I have written a PLI program to read KSDS data set.. The following is the small snippet that reflects entire program logic.

The main problem here is I have used CMF_KEY as the key which is group item.. Its giving compilation error like...

"AGGREGATE 'CMF_REC.CMF_KEY' USED WHERE ELEMENT EXPRESSION IS REQUIRED"



Could anybody suggest where should I correct it?


/* File Declaration */
0DCL CMFFILE FILE RECORD INPUT SEQUENTIAL BUFFERED
ENV(INDEXED KEYLOC(2) KEYLENGTH(12)),


/* Record Layout for KSDS */

0DCL
01 CMF_REC,
03 PPISAMDELETE CHAR(1),
03 CMF_KEY,
05 PPDDDPRODUCT,
07 PPDPMFR FIXED DECIMAL(5),
07 PPDPSEQ FIXED DECIMAL(10),
05 PPRECORDTYPE CHAR(1) INIT('H'),
05 PPCNTRLNO FIXED DECIMAL(3),
03 FILLER CHAR(125)
;



/* Read Statement */

PPDPMFR= some defined values......
PPDPSEQ= some defined values....
PPRECORDTYPE= 'I';
PPCNTRLNO= 0;
READ FILE(CMFFILE) INTO(CMF_REC) KEY(CMF_KEY);




Thanks and Regards,
Sai Krishna
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Apr 13, 2004 7:21 am    Post subject: Reply with quote

kris_madras,

Try this

Code:

DCL CMFFILE FILE RECORD INPUT SEQUENTIAL BUFFERED     
ENV(INDEXED KEYLOC(2) KEYLENGTH(12));                 
/* RECORD LAYOUT FOR KSDS */                           
 DCL                                                   
01 CMF_REC,                                           
03 PPISAMDELETE CHAR(1),                               
03 CMF_KEY CHAR(12),                                   
03 PPRECORDTYPE CHAR(1) INIT('H'),                     
03 PPCNTRLNO FIXED DECIMAL(3),                         
03 FILLER CHAR(125)                                   
;                                                     
                                                       
DCL                                                   
01 CMF_KEY1 CHAR(12);                                 
                                                       
DCL                                                   
01 CMF_KEY2 BASED(ADDR(CMF_KEY1)),                     
05 PPDPMFR FIXED DECIMAL(5),                           
05 PPDPSEQ FIXED DECIMAL(10);                         
 
/* READ STATEMENT */                             
CMF_KEY2.PPDPMFR= some defined values......;
CMF_KEY2.PPDPSEQ= some defined values......;
CMF_KEY = CMF_KEY1;                               
PPRECORDTYPE= 'I';                               
PPCNTRLNO= 0;                                     
READ FILE(CMFFILE) INTO(CMF_REC) KEY  (CMF_KEY); 


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
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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