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

Cobol -Db2 issue


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Dec 29, 2009 10:57 am
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
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Dec 29, 2009 11:24 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top