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

How to inquire the keyposition and keylength of a file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ankit saxena

New User


Joined: 06 Oct 2010
Posts: 55
Location: india

PostPosted: Tue Oct 26, 2010 6:44 pm
Reply with quote

hi all,
i am trying to fetch the keyposition and key length of a file using

EXEC CICS
INQUIRE
FILE(FCT1)
KEYLENGTH(KEYL)
KEYPOSITION(KEYP)
RESP(RESPONSE-CODE)
END-EXEC
DISPLAY ' KEY POSITION ' KEYP
DISPLAY ' KEY LENGTH ' KEYL
but when i am displaying the value of keyl and keyp its not showing any thing

CAG2NG57 20101026182718 KEY POSITION
CAG2NG57 20101026182718 KEY LENGTH

can any of you please check what is the problem...
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Oct 26, 2010 6:56 pm
Reply with quote

Since we don't have access to your system, I doubt we can "check what is the problem" -- only someone at your site could do this.

Possible problems I see:
1. File FCT1 is closed and the key data is not part of the definition -- the fields will be zero in this case (and no, the inquiry does not open the file).

2. KEYP is not a fullword binary field.

3. KEYL is not a fullword binary field.

4. FCT1 is not defined as a file to the CICS region.
Back to top
View user's profile Send private message
ankit saxena

New User


Joined: 06 Oct 2010
Posts: 55
Location: india

PostPosted: Tue Oct 26, 2010 7:25 pm
Reply with quote

Hey thanks
can u please tell me what exact is the picture clause for full word binary.

and can u tell me if i am using a copybook in a CICS- COBOL pgm

and i am having a field of

01 A PIC 9(R).

so now i want to change (R) to a value provide by online CICS program .

is it possible ???
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Oct 26, 2010 7:35 pm
Reply with quote

Code:
77  KEYP PIC S9(08) COMP-5.
will define the variable as a fullword binary variable. Using COMP-5 for CICS is better than using COMP as you don't have to worry about compiler options with COMP-5.

The value R must be filled in before the program is compiled. Hence, by definition, you cannot provide R in an online CICS program. COBOL requires every variable length be known at compile time.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top