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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to write COMP/COMP-3 data in VSAM files.
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Thu Jun 05, 2008 12:15 pm    Post subject: Reply to: How to write COMP/COMP-3 data in VSAM files.
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    Post subject: Reply to: How to write COMP/COMP-3 data in VSAM files.
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Thu Jun 05, 2008 12:28 pm    Post subject: Reply to: How to write COMP/COMP-3 data in VSAM files.
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

Active Member


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

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

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

Site Director


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

PostPosted: Thu Jun 05, 2008 10:11 pm    Post subject:
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

Site Director


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

PostPosted: Sat Jun 07, 2008 1:18 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Sat Jun 07, 2008 1:42 am    Post subject: Reply to: How to write COMP/COMP-3 data in VSAM files.
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    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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


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