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
 

 

Iam not get set verb exactily use

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
HARIBHARAT

New User


Joined: 05 Jul 2006
Posts: 65
Location: pune

PostPosted: Tue Sep 05, 2006 5:34 pm    Post subject: Iam not get set verb exactily use
Reply with quote

SET TIBGBAL-INVD-PRM
GRD-INVLD-INPT-PARM
GRD-ERR-INVLD-INPT-PARM TO TRUE

what is above code mean
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Sep 05, 2006 5:52 pm    Post subject:
Reply with quote

Suppose i am declaring a variable like that
EXEC SQL
DECLARE SOICUR FOR
SELECT POLICY_NUMBER
FROM ILF010VW
END-EXEC

10 WS-DB2-ILF010-RECORDS PC X(1) VALUE 'N'.
88 WS-DB2-ILF010-OVER VALUE 'Y'.




PROCEDURE DIVISION.
....
PERFORM A1000-OPEN-CURSOR.
PERFORM A2000-FETCH-CURSOR UNTIL WS-DB2-ILF010-OVER
PERFORM A300-CLOSE-CURSOR.


A1000-OPEN-CURSOR SECTION.
A1000-START.
EXEC SQL
OPEN SOICUR
END-EXEC.
EVALUATE SQLCODE
WHEN +0
CONTINUE
WHEN OTHER
RAISE AN ERROR
END-EVALUATE.

A1099-EXIT.

A2000-FETCH-CURSOR SECTION.
A2000-START.
EXEC SQL
FETCH SOICUR INTO :WS-POLICY-NUMBER
END-EXEC.
EVALUATE SQLCODE
WHEN +0
CONTINUE
WHEN +100
SET WS-DB2-ILF010-OVER TO TRUE
WHEN OTHER
RAISE AN ERROR
END-EVALUATE.

A2099-EXIT.
EXIT.

A3000-CLOSE-CURSOR SECTION.
A3000-START.
EXEC SQL
CLOSE SOICUR
END-EXEC.
EVALUATE SQLCODE
WHEN +0
CONTINUE
WHEN OTHER
RAISE AN ERROR
END-EVALUATE.

A3099-EXIT.
EXIT.



In this we declare avariable to identify there is no more row to fetch so whenever it got sqlcode +100 it is setting a flag which is used for looping

Hope it will be helpful
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Sep 05, 2006 10:17 pm    Post subject: Re: Iam not get set verb exactily use
Reply with quote

HARIBHARAT,

Quote:

SET TIBGBAL-INVD-PRM
GRD-INVLD-INPT-PARM
GRD-ERR-INVLD-INPT-PARM TO TRUE


TIBGBAL-INVD-PRM, GRD-INVLD-INPT-PARM , GRD-ERR-INVLD-INPT-PARM are all 88 level names under a variable. The code above sets the variable to the value associated with the 88 level.

See the code and results below:

Code:

WORKING-STORAGE SECTION.                             
                                                     
01  A              PIC X VALUE 'N'.   
    88 A-T               VALUE 'T'.   
    88 A-F               VALUE 'F'.   
01  B              PIC X VALUE 'N'.   
    88 B-T               VALUE 'T'.   
    88 B-F               VALUE 'F'.   
01  C              PIC X VALUE 'N'.   
    88 C-T               VALUE 'T'.   
    88 C-F               VALUE 'F'.               
                                                     
LINKAGE SECTION.                                     
                                                     
PROCEDURE DIVISION.                                 
                                                     
PROGRAM-START.                                       
                                                     
    SET A-T B-F C-T TO TRUE.
                       
    DISPLAY 'A  = ' A ', B = ' B ', C = ' C.
                                             
    GOBACK.


Result

Code:

.SARPAGE 4             
.                     
.A  = T, B = F, C = T 


If there is still a question, please come back.

Dave
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Logic of START verb with Read next sandeep kumar302 COBOL Programming 6 Tue Feb 04, 2014 12:21 pm
No new posts Calling sub program using CALL verb Ron Masters COBOL Programming 16 Fri Apr 06, 2012 4:37 pm
No new posts Need help in understanding the Move v... Himanshu Pant COBOL Programming 2 Fri Mar 30, 2012 2:47 pm
No new posts Capturing the EX value x'15' using IN... ragu.vst COBOL Programming 8 Mon Dec 19, 2011 10:12 pm
No new posts Why TEST verb used with INITIALIZE MoganaKumaran COBOL Programming 6 Tue Apr 05, 2011 6:52 pm


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