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 identify if PD,COMP are in file without using Cpybok

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mohans_472

New User


Joined: 11 Oct 2009
Posts: 4
Location: hyderabad

PostPosted: Sun Oct 11, 2009 1:59 pm    Post subject: How to identify if PD,COMP are in file without using Cpybok
Reply with quote

We are required to migrate the system andporting the files from mainframes to unix.
To port a file we have to find the copybook of the file.Presently we are back tracking from jCl and identifying the copybook associated to that file . Depending on the data type (packet decimal,comp etc)we have treat that feild differently.
Process to identify the exact copybook for each file takes time and prone to errors.So to cross verify i want to know if we could confirm from the file if there is any of these feilds in that file without using copybook.

Presently we are using " F ALL P'.' " assuming it will identify whether any packet data is present in the file.
Do we have any procedure or commands to identify the type of data feilds at a high levels.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Sun Oct 11, 2009 3:38 pm    Post subject:
Reply with quote

GuyC, really worked hard not to be 'aggressive'.

mohans_472,

You can not process the data in the UNIX system
without an accurate description of the records of each file.
which means you have to find the copybooks that contain the record description.
Actually, without the record descriptions, how was the UNIX system developed?
Quote:
Presently we are using " F ALL P'.' " assuming it will identify whether any packet data is present in the file.

The ISPF EDIT command - Find ALL P'.' - only provides non-display char,
has nothing to do with PACKED-DECIMAL.
Quote:
Process to identify the exact copybook for each file takes time and prone to errors.

why is this an error prone process?
This should be a rather easy exercise -
it is what every consultant does during the first few hours at a new site.
Back to top
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Sun Oct 11, 2009 5:35 pm    Post subject:
Reply with quote

Quote:
why is this an error prone process?


I've spent half a day tracking down one copybook for a file that was read in as a PIC X(80) (for example) then moved to various other copybooks in various subroutines. Maybe that's what the OP means?

But yeah, for the general question 'determine file layout without copybook' there is no solution. I've seen a couple of academic papers and I think there was book about the subject ('data reverse engineering') as well.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Sun Oct 11, 2009 7:05 pm    Post subject:
Reply with quote

mtaylor,

I understand that garbage coding techniques make it laborious to find definitions,
but 'error prone process'?
maybe that should read 'error prone processors'.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Sun Oct 11, 2009 7:15 pm    Post subject:
Reply with quote

Quote:
Do we have any procedure or commands to identify the type of data feilds at a high levels.
You have a string of 4 bytes that have the values x'0097994D' -- what do they represent? If it is a COMP field, it represents the value 9935181. If it is a COMP-3 field, it represents the value -97994. If it is a DISPLAY field, it represents the value <low value>pr(. And that just assumes the data is EBCDIC -- there are other answers for ASCII.

But without knowing the format of the data in advance, you cannot tell by inspection if the value is 9935181, -97994, or .pr( -- they are all three perfectly valid representations of the same four bytes.
Back to top
View user's profile Send private message
mohans_472

New User


Joined: 11 Oct 2009
Posts: 4
Location: hyderabad

PostPosted: Tue Oct 13, 2009 11:11 pm    Post subject: Reply to: How to identify if PD,COMP are in file without usi
Reply with quote

I am sorry for not being clear by saying"prone to error" i mean the manual error that was invovled in the process.

As i said we are porting the files from mainframes to unix and for that we are using a product"DMEXPRESS" from syncsort(similar ti Fileport) .
Dmexpress expects the complete file layout as it treat the packed data,COMP,numeric fields differently.
Presently we have around 2500+ files to be ported but in our inventory the cobol program coding standard is not specific . In copybook it is declared as alphanumeric but some fields of the copybook are getting populated with other types of data by other program called within the main program. Our file lenght are much as 16000 so its taking lot of man hours and analysis and there is always a hesitation if we missed out any feilds is within us.

So for reducing some of our efforts we want to know if the field contains only characters or numeric faulds only(in either case there is no need of layout description to DMEXPRESS).Assuming that these fields will not be having non printable characters we are checking for "F P'.' all'" in the file.
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Could we identify the called modules ... elixir1986 COBOL Programming 5 Fri Jul 14, 2017 1:53 am
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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