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
 

 

Conversion of file from PD/ZD to Display format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Conversion of file from PD/ZD to Display format
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

Site Director


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

PostPosted: Tue Jul 03, 2007 10:26 pm    Post subject:
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

Active Member


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

PostPosted: Tue Jul 03, 2007 10:41 pm    Post subject:
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

Site Director


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

PostPosted: Wed Jul 04, 2007 12:06 am    Post subject:
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    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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