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

Conversion of file from PD/ZD to Display format


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

New User


Joined: 04 Jun 2007
Posts: 2
Location: USA

PostPosted: Tue Jul 03, 2007 10:10 pm
Reply with quote

This is my Challenge. I tried to search in this forum and could not get it.

1. I have 40 PS files with variable and fixed length
2. These 40 files have PD and ZD in them
3. I need to build one single program which takes in both variable and fixed length files , Identifies the PD and ZD and convert them to unpacked display format.
4. The output file should be fixed length file
5. Need a cobol program/Utility to do this

Let me know if someone as any insight in to it.
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: Tue Jul 03, 2007 10:26 pm
Reply with quote

Hello,

You need to more clearly explain your requirement.

For one thing, i believe ZD is "unpacked display format' unless you have something else in mind.

Fields are defined, not identified by or detected from the content. There is no way to look at data programmatically and determine how long a "field" is or what data format it is. You might detect the low-order byte of a packed-decimal field, but not with any guarantee - you would also not be able to guarantee finding the length from the data.

Who came up with this "need"
Quote:
I need to build one single program which takes in both variable and fixed length files , Identifies the PD and ZD and convert them to unpacked display format.
It is surely not a business requirement.

If these are files that have been in use in your environment, it is likely that they have cobol copybooks. If you take the existing copybooks, and clone them, you could define the needed output fieldsd in the "new" copybooks. You could use both copybooks in a program and move the old format data to the new, unpacked format data. These would be trivial programs and once one was running, the remainder would be even more trivial.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


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

PostPosted: Tue Jul 03, 2007 10:41 pm
Reply with quote

Dick -

I would consider display format to require separate sign (trailing or leading), rather than as part of the rightmost byte.
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: Wed Jul 04, 2007 12:06 am
Reply with quote

Hi Phil,

Yup, i'd go along with that
Quote:
consider display format to require separate sign (trailing or leading)
my bad icon_redface.gif

When i mentioned right-most (low-order) byte, i was thinking of packed-decimal and the ability to differentiate between a PD field that happened to be adjacent to a binary field.

I can think of no way to derive field type/length from say 300 bytes of data - which is the requirement if i understand correctly.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Jul 04, 2007 8:23 pm
Reply with quote

Dick,

Rajith didn't mention any other data types. If these are the only 2 types in the files, you may be able to separate them.

But he may be confusing ZD with binary. In that case it can't be done.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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 Populate last day of the Month in MMD... SYNCSORT 2
Search our Forums:

Back to Top