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 read numeric value from seq file to a PIC 9(3) COMP-3

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to read numeric value from seq file to a PIC 9(3) COMP-3
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

Site Director


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

PostPosted: Sun Aug 24, 2008 9:21 am    Post subject:
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: 2180
Location: @my desk

PostPosted: Sun Aug 24, 2008 9:33 am    Post subject:
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    Post subject: Thanks!!
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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