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

What does Unpacking all packed fields means?


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Tue Apr 03, 2007 12:44 pm
Reply with quote

I have a requirement:

We were NDM'ing one file to a location which will be FTPed now.

My Onsite guy says, before doing this we need to unpack the file as this is the requirement, he wrote to me:

"However, first we have to expand the file lrecl by unpacking all packed fields. This can be done via a program or the IEBGENER utility."

Please could someone tell me what does he mean by this.


The file format goes like this:

010............ .? .
020 01.........X290075000 000000000000610270
020 01.......??P363347000 000000000009804270
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 03, 2007 12:56 pm
Reply with quote

Basically the pack fields use the two half bytes to store numeric data, if you browse a file you may see what appears to be a lot of garbled rubbish

but if you type "HEX" on the command line you will see something like
Code:

&^..
4630
2119


So when you unpack it you are taking the value stored in each half byte and transforming it into displayable data, with each character taking a full byte. So by unpacking the data instead of seeing &^.. you would see 42613109
Back to top
View user's profile Send private message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Tue Apr 03, 2007 1:10 pm
Reply with quote

Thanks man....

But tell me one thing do we require a program to do that?

...And what is the IEBGENER utility my onsite guy is talking about...I mean how can we use it.

How will it happen...is what I want to know.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 03, 2007 1:13 pm
Reply with quote

You need something to reformat the data. I've never used IEBGENER to do it, but that doesn't mean that it will not work with IEBGENER. I'd be interested in finding out too.

IEBGENER is contained in the "UTILITIES" manual which you can view by clicking on the "Manuals" link at the top of this page.
Back to top
View user's profile Send private message
sri.mainframes

New User


Joined: 16 Feb 2006
Posts: 29
Location: MUMBAI

PostPosted: Tue Apr 03, 2007 1:31 pm
Reply with quote

Hi Shitij,

write a COBOl program to unpack the data.

say input record has 80 LRECL and you need to unpack the data from 7th position to 14th posotion of a record in a file.
in out-rec layout declare the 3rd filed as numeric like 9(14)

read the input-record one by one and move it to the output-record
MOVE IN-REC(1:6) TO OUT-REC(1:6)
MOVE IN-REC(7:7) TO OUT-REC(7:14)
MOVE IN-REC(14:66) TO OUT-REC(21:66)
WRITE OUTFILE

try this and let me know the result.

Thanks
Sri.Prince
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 03, 2007 1:42 pm
Reply with quote

Why write a program when IEBGENER does it already ?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Apr 03, 2007 3:17 pm
Reply with quote

Hi There,

You can also use sort for this
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 Apr 03, 2007 9:06 pm
Reply with quote

Hello,

Is this something that will be ongoing rather than a one-time shot?

For an ongoing requirement, i'd recommend creating a copy book of the original and the new format files and use them in a simple COBOL program.

Moving old-field to new-field is [b]much/b] more readable than lengths and displacements (regardless of which utility is used). Also, when the record layout changes, the work required to accomodate the new format(s) is trivial w/ copybooks. If the utility job has many fields and the change is "early" in the record, all of the displacements need to be changed which will waste time and be prone to errors and extra debugging.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
Search our Forums:

Back to Top