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

Length if a DB2 Variable field


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SCARCEBOYZ

New User


Joined: 16 May 2005
Posts: 32
Location: Millenium Business Park, Mumbai

PostPosted: Wed Sep 10, 2008 2:16 pm
Reply with quote

Hello All,

During a client interview, I was asked a very strange question that "How will you find length of a DB2 Variable" ? Though I answered that in DB2 we take the data from table so by seeing the table declaration we can tell the length of the field but interviewer was not satisfied?If anybody know the correct answer, please let me know?

Another question was "How do we know that a cics command has successfully executed". I answered "RESP" command.Please let me know if this is a correct answer?

Regards,
Vivek
Back to top
View user's profile Send private message
snehalpatel

New User


Joined: 13 Sep 2007
Posts: 37
Location: India

PostPosted: Wed Sep 10, 2008 3:01 pm
Reply with quote

SCARCEBOYZ wrote:
Hello All,

During a client interview, I was asked a very strange question that "How will you find length of a DB2 Variable" ? Though I answered that in DB2 we take the data from table so by seeing the table declaration we can tell the length of the field but interviewer was not satisfied?If anybody know the correct answer, please let me know?

Regards,
Vivek


Hi

As per my knowledge, If the Column defination is for an VARCHAR, then we do have Length component with it.

EXEC SQL DECLARE TEST_A TABLE
(TEST_COL VARCHAR(900) NOT NULL
) END-EXEC.

then Corresponding cobol declaration would be

01 DCLTEST_A
10 TEST-COL.
49 TEST-COL-LEN PIC S9(4) USAGE COMP.
49 TEST-COL-TEXT PIC X(900).

At run time "TEST-COL-LEN " will have length of field

Regards,
Snehal Patel
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Sep 10, 2008 7:43 pm
Reply with quote

2nd question: almost correct, you have to check the EIBRESP field (located in DFHEIBLK)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 10, 2008 8:47 pm
Reply with quote

don't you have to include the RESP (and when wanted RESP2) parm in the CICS API CALL?
Back to top
View user's profile Send private message
SCARCEBOYZ

New User


Joined: 16 May 2005
Posts: 32
Location: Millenium Business Park, Mumbai

PostPosted: Fri Sep 12, 2008 5:28 pm
Reply with quote

Yes..You need to .EIBRESP2 contains more detailed information that may help explain why the RESP condition occurred. This field contains meaningful values, as documented with each command to which it applies. For requests to remote files, EIBRESP2 contains zeros. If a program uses DPL to link to a program in another CICS region, an EIBRESP2 from the remote region is not returned to the program doing the DPL.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top