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
 

 

Cobol -Db2 issue

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

New User


Joined: 13 May 2008
Posts: 5
Location: hyderabad

PostPosted: Tue Dec 29, 2009 9:49 am    Post subject: Cobol -Db2 issue
Reply with quote

Hi,

Posting this on behalf of a friend. Please suggest a solution to this problem.

Thanks in advance

Prog 1 :

I reading all the rows of a table in to a PS file with the data PIC clause similar to the DCL gen variables. (retained the Comp / comp-3 data types)


Prog2: (problem area)

I am trying to read a key field from the PS which was written in the PROG1 which is a s9(9) comp usage variable and trying to delete the row with this record in the table.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1) FD for the file

FD ESHDSQFL
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 00 CHARACTERS.
01 FS-ESHDREC PIC X(448).


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

01 WS-ESHDREC.
05 W01S-ESTIMATE-BK-NBR PIC S9(9) USAGE COMP.
05 W01S-REMAINING PIC X(444).

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2) READING IN TO WS VARIABLE

READ ESHDSQFL INTO WS-ESHDREC

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


3)Deletion after reading

*****************************************************************
* DELETES DATA FROM TSESHDTB *
*****************************************************************
2050-DELETE-ESHD.
DISPLAY 'DELETING FROM ESHD' W01S-ESTIMATE-BK-NBR
EXEC SQL
DELETE
FROM TSESHDTB
WHERE ESTIMATE_BK_NBR = :W01S-ESTIMATE-BK-NBR
END-EXEC.

EVALUATE SQLCODE
WHEN SQL-SUCCESS
ADD 1 TO WS-TSESHDTB-DELS
DISPLAY W01S-ESTIMATE-BK-NBR 'DELETED ESHD'
*****QUICKSTART
PERFORM AAUTCC14-CKPT-RTN
WHEN SQL-NOTFOUND
ADD 1 TO WS-TSESHDTB-EXCP
WHEN OTHER
DISPLAY '***********************************'
DISPLAY '* ERROR ! *'
DISPLAY '***********************************'
DISPLAY '* FAILED IN DELETING FROM ESHD *'
DISPLAY '* IN 2050-DELETE-ESHD *'
DISPLAY '* SQLCODE *'
SQLCODE
DISPLAY '* ESHD *'
W03S-JOB-NUMBER
DISPLAY '***********************************'
PERFORM SQL-STAT
END-EVALUATE.

Error in red Is the error encountered
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


Sysout data:


DELETING FROM ESHD292645166 <-this is the displayed variable in comp format***********************************
* ERROR ! *
***********************************
* FAILED IN DELETING FROM ESHD *
* IN 2050-DELETE-ESHD *
* SQLCODE *000010000L
* ESHD *
***********************************
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10277
Location: italy

PostPosted: Tue Dec 29, 2009 10:57 am    Post subject: Reply to: Cobol -Db2 issue
Reply with quote

You tell that You are posting on behalf of a friend, but the You use the first person to describe the problem icon_confused.gif

aternatives
-1 your friend is internet challenged
-2 you are trying to blame on somebody else Your issues

anyway
the way You colored Your post does not make sense,
You are just highlighting the application code where the error has occurred
( and we could not care less about it)

but You forget to highlight the only useful ( and wrongly displayed ) info ...
I.E (*) the sql code

obviously <the human entity> facing the issue did not care to look at the sql code in the manuals
the L in the code displayed stands for a negative 3 so search for it
also make sure that the SQL code displayed has been formatted properly

(*) ID EST ==> THAT IS

P.S.
see this post for the decoding of the sign part of a zoned number
http://ibmmainframes.com/viewtopic.php?t=45523&highlight=negative
Back to top
View user's profile Send private message
sravantid

New User


Joined: 13 May 2008
Posts: 5
Location: hyderabad

PostPosted: Tue Dec 29, 2009 11:19 am    Post subject: Reply to: Cobol -Db2 issue
Reply with quote

Hi,

This is for your information.

My friend posted the issue in a forum and i just pasted it here so that i can get a quick solution. So let's concentrate on the prob here than on the grammar.

Sorry for being rude.

Thanks,
Sravanti
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10277
Location: italy

PostPosted: Tue Dec 29, 2009 11:24 am    Post subject: Reply to: Cobol -Db2 issue
Reply with quote

Quote:
This is for your information.
I have no need for anybody to inform me, I can read the sources of useful info myself
Quote:
My friend posted the issue in a forum...
posting the same question on multiple forum just shows bad manners
Quote:
...and i just pasted it here so that i can get a quick solution.
if the <humanbeinghavingtheissue>wants a quick solution a no charge forum is not the best place to ask
usually reading the manuals <humanbeinghavingtheissue>self is at least two order of magnitude faster
than asking on a forum and expect somebody else to do it on behalf of the <humanbeinghavingtheissue>
see (1)

Quote:
So let's concentrate on the prob here than on the grammar.
the <humanbeinghavingtheissue> has to concentrate, I do not have any need to
( as an alternative You can advise tomatoes about it )

Quote:
Sorry for being rude.
bullsith, if You were sorry You would not have written it icon_cool.gif
You should be more respectful, I took time to explain what <humanbeinghavingtheissue> should do...
so ther is work to be done


(1)people reply on their own time, based on the topic interest, number of time the same issue has surfaced on forums and ...
the benevolence factor toward the topic starter ( tending to 0 in this case )
Back to top
View user's profile Send private message
sravantid

New User


Joined: 13 May 2008
Posts: 5
Location: hyderabad

PostPosted: Tue Dec 29, 2009 12:37 pm    Post subject:
Reply with quote

Thanks a lot for the information

Namaste icon_smile.gif
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


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