Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Length if a DB2 Variable field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Length if a DB2 Variable field
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    Post subject: Re: Length if a DB2 Variable field
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: 1226
Location: Israel

PostPosted: Wed Sep 10, 2008 7:43 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Length if a DB2 Variable field
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us