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

How to write COMP/COMP-3 data in VSAM files.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ankur Khandelwal

New User


Joined: 03 Jun 2008
Posts: 2
Location: India

PostPosted: Thu Jun 05, 2008 12:12 pm
Reply with quote

Hi ,

In File description(FD), i have COMP and COMP-3 variables .Now I have manually inserted the data in the VSAM file according to above FD,
but when i read and displayed that COMP/COMP-3 variables , it is showing some other value .Can anyone help me regarding this.


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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jun 05, 2008 12:15 pm
Reply with quote

check the manuals for the description of the COMP attribute

show the hexadecimal representation of what You have inserted
and the one of what You are getting,

and remember in IT(information technology) GIGO(garbage in garbage out) icon_biggrin.gif
Back to top
View user's profile Send private message
Ankur Khandelwal

New User


Joined: 03 Jun 2008
Posts: 2
Location: India

PostPosted: Thu Jun 05, 2008 12:24 pm
Reply with quote

Thanks for reply...

Values which we are getting are not Hexadecimal equivalent of what we have inserted in file...we want to know what is the way to insert COMP/COMP-3 value in VSAM file ???
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jun 05, 2008 12:28 pm
Reply with quote

How do You expect help without answering...

review the record layout...
understand the COMP-3 specification

post what was asked

an idcams print will give the content of the record and You can hand check the correspondence of the data to your record layout

but ... no data no answer
icon_cool.gif
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Jun 05, 2008 5:39 pm
Reply with quote

Also, this is not a VSAM issue.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 05, 2008 10:11 pm
Reply with quote

Hello Ankur Khandelwal and welceom to the forums,

Quote:
Now I have manually inserted the data in the VSAM file according to above FD,
How did you do this? "Manually" inserting data into files is not a good practice. Did you verify that what you inserted was correct (using whatever you used to manually insert n the first place)?

Quote:
we want to know what is the way to insert COMP/COMP-3 value in VSAM file ???
The same as any other file or database table. Data is typically MOVEd from where it was input to the "output" area and then written, inserted, updated, etc.

As previously mentioned, you need to provide the requested info for us to be able to help you.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Jun 07, 2008 1:18 am
Reply with quote

Hello,
Ankur wrote:
I have a cobol Online/DB2 program 'A' which I need to test on Xpeditor. This program is called by another program 'B' by passing some values. Now, instead of using 'B' I have to use a Test-Harness program (for testing purpose) which will retrieve a values from a VSAM file and call program 'A' by passing these values (as would pass by 'B'). I have created a VSAM file which have the following File Description (in copybook) :-

01 DATA-RECORD
05 DATA-1 PIC S9(9) USAGE COMP
05 DATA-2 PIC S9(10)V USAGE COMP-3
05 DATA-3 PIC 9(4)

(If 'B' would be there , it would populate the above variables and pass them to the 'A')

After passing these values from Test-harness program to program 'A, Program 'A' will execute the SQL query (select,update) on the basis of these values. Now, when I m doing testing, DATA-3 is coming same as I have provided in VSAM file...but DATA-1 and DATA-2 are not coming same...they are coming some different values with negetive sign...as a result execution of SQL Query gives "SQLCODE 100" as DATA1 and DATA2 is used in WHERE Clause. Now as I said, I am new to VSAM...so, I want to know "What is the way to insert DATA-1 and DATA-2 in VSAM File ?" so that they are reflected in program 'A' as same as I have provided in VSAM file.

Please let me know if some more info is required.

Thanks
ANKUR


Once you have a copybook like the one you posted, the programming to use those fields is the same as any other file or working-storage data item. If i understand what you are trying to do (test the called module with a dummy front-end caller), why is a vsam file needed?

To simplify your testing, could you not simply use instream data and then set up your call accordingly? You could use the same "copybook", but you would move in the values from the instream data rather than using the vsam file.

If there is some reason this must use a vsam file, please explain.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Jun 07, 2008 1:42 am
Reply with quote

why don' t You write a quick and dirty program
to write one record with some data relative to the layout You are not sure about ????
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 How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top