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

How to read numeric value from seq file to a PIC 9(3) COMP-3


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

New User


Joined: 27 Sep 2005
Posts: 8
Location: Gurgaon

PostPosted: Sun Aug 24, 2008 8:57 am
Reply with quote

Seq file:-
****************************************************
1234
******************end of file**************************
Cobol prog:-
in Copybook

10 VAR-1 PIC 9(4) USAGE COMP-3
.
.
.

I want to create a seq file and populate value 1234 in it and I need to read it into my cobol prog in field defined as PIC 9(4) USAGE COMP-3.

Is it possible? The value in the seq file is NOT in packed decimal form.
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: Sun Aug 24, 2008 9:21 am
Reply with quote

Hello,

Yes, just define the field in the file as pic 9(4). If the data might be signed, use s9(4) for the definition.

In your program, move the file field to the working storage field.

If there is a chance the field in the file might not be numeric, you should test for numeric otherwise there will be problems later.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Aug 24, 2008 9:33 am
Reply with quote

Kushal,

Are you trying to set up data according to your cobol copybook?
If you have fileaid, open the file using the layout and enter values. It will get saved in the format defined in the layout.

Thanks,
Arun
Back to top
View user's profile Send private message
gaps030980

New User


Joined: 27 Sep 2005
Posts: 8
Location: Gurgaon

PostPosted: Sun Aug 24, 2008 9:51 am
Reply with quote

icon_biggrin.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 FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top