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

How to search and move a value from a file having no layout


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

New User


Joined: 10 Jul 2006
Posts: 2

PostPosted: Thu Mar 08, 2007 1:52 pm
Reply with quote

Hi

Can anybody suggest me how to resolve the mentioned issue.

I have a file in the form of a segments and cannot be mapped to a layout, as shown below.

AM04 C2880054109 CCROHAN CDNAIK FOH5526 C91 C100982203 C3001 C61

i need to check for the fild separtor , Ex - I am searching for C2 and if found, i need to move the value untill next separator(CC) i.e 880054109 to a output file varable.

Please suggest me how to procced in this type of scenario.

Thanks & Regards
Rajesh
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Mar 08, 2007 4:39 pm
Reply with quote

If "C" is the delimiter then UNSTRING is up to the task.
Back to top
View user's profile Send private message
RAJESHB4U

New User


Joined: 10 Jul 2006
Posts: 2

PostPosted: Thu Mar 08, 2007 7:27 pm
Reply with quote

William Thompson wrote:
If "C" is the delimiter then UNSTRING is up to the task.


Hi,

The given file is a variable file, so reference modification cannot be used and i have more the one occurance of C, but i want only "880054109" from the file, without using many unstring functions

AM04 C2880054109 CCROHAN CDNAIK FOH5526 C91 C100982203 C3001 C61
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Mar 08, 2007 7:42 pm
Reply with quote

Quote:

The given file is a variable file, so reference modification cannot be used

Could you please explain why???
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 Mar 08, 2007 9:37 pm
Reply with quote

Hello,

Please post the file definition of the file.

You may use reference modification on a variable length record. At this point, i'm not sure that the definition is clear enough to make recommendations.

What should happen if there is a "C2" and there is no "CC" or the "CC" is encountered 100 bytes later?

When you post more of your "rules", we will offer suggestions.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Fri Mar 09, 2007 11:06 am
Reply with quote

Your Scenario can be easily handled with SAS program.

Do you want SAS solution?
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 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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top