View previous topic :: View next topic
|
Author |
Message |
shitij
New User
Joined: 09 Sep 2005 Posts: 31 Location: Delhi
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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
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 |
|
|
shitij
New User
Joined: 09 Sep 2005 Posts: 31 Location: Delhi
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
sri.mainframes
New User
Joined: 16 Feb 2006 Posts: 29 Location: MUMBAI
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why write a program when IEBGENER does it already ? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
You can also use sort for this |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|