View previous topic :: View next topic
|
Author |
Message |
Ankur Khandelwal
New User
Joined: 03 Jun 2008 Posts: 2 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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) |
|
Back to top |
|
|
Ankur Khandelwal
New User
Joined: 03 Jun 2008 Posts: 2 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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
|
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Also, this is not a VSAM issue. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
|