View previous topic :: View next topic
|
Author |
Message |
sijayapal
New User
Joined: 23 Dec 2008 Posts: 69 Location: India
|
|
|
|
Hi All,
I am trying to copy a file, convertion all the packed decimal data to displayable data (alpha numeric).
I provided the source file, source copybook and destination file and a destination copybook. The source copybook lets say has an amount fileld with S9(4)V99 COMP-3, on the destination copybook I specified X(8), the file manager converted the data and i am able to see the actual amount in the output file.
This process of creating the output copybook is manual and i am looking forward to see if there is an option in File Manager that i could use to auto generate the output format?
Or is there anyother easy way with file manager to copy a file with the packed decimal data to another file with actual data in alphanumeric? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
I don't know much about FM but I would say "No" to the first question and "I don't think so" to the second.
But here is an idea:
Why don't you add a small SORT step that takes the IN copybook, removes all 'COMP-3' and 'COMP' and so on, and outputs a new (temporary) OUT copybook to be used by FM.
The amount field would show as "S9(4)V99." but you could also improve this... |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
And with 66 posts here already, why did you try somewhere else first?
Same questions as there. |
|
Back to top |
|
|
sijayapal
New User
Joined: 23 Dec 2008 Posts: 69 Location: India
|
|
|
|
Marso, Thanks for the idea. I tried it, it works but the problem is, the people i am dealing with has limited or no knowledge on mainframe.
I wrote a REXX to do the conversion and I thought i nailed it. The REXX works like a charm. But since i am manipulationg the copybook, they are not happy with it. They are not understanding its just a type conversion to X. As long as the length matches they won't have issue with the data. I am trying to explain my best but wanted to see if the tool has an option to do it and they will be happy about it.
Ok coming to your point, if we use S9(4)V99, the display value is not straight forward. The last byte will have the sign and value which they will not be able to decode. I can write a formula in excel or something to do it but still they won't be happy about it.
I understand its a dumb question but sometimes dumb things make a huge difference. |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
If I understand it correctly,
Quote: |
I am trying to copy a file, convertion all the packed decimal data to displayable data (alpha numeric) |
Quote: |
As long as the length matches they won't have issue with the data. |
It seems like you want to change the packed data to displayable data but don't want to change the copybook length ??
Do you really think that is possible?
is this what you want ? |
|
Back to top |
|
|
sijayapal
New User
Joined: 23 Dec 2008 Posts: 69 Location: India
|
|
|
|
Quote: |
It seems like you want to change the packed data to displayable data but don't want to change the copybook length ??
Do you really think that is possible?
is this what you want ? |
Well let me put it clear. File manager internally understands and displays the packed deimal data and displays it as a readable text in foreground.
All i am looking for is, Is it possible to save that displayed value into a file? I don't want to view in forground. But i need that information in a file.
To acheive that here is what i tried -
1. Copy file option under uitilities
2. Provide the input data set, copybook.
3. Choose batch
4. Provide, output dataset name, left the copybook blank
5. Submit the job
It just copied the file to a new file which perfectly makes sense.
Then I created a new copybook out of the actual copybook to be used as output copybook with all the numeric fields converted to alphanumeric keeping the field names same.
Then tried to copy again but this time i provided my new copy book as output copybook. The file copied but this time all the packed decimal data is converted to the actual value that will be displayed in the forground which is cool.
All i wanted to understand is that if the file manager has the sophistication to generate a similar copybook ( as i described above) that i could use as output copybook. Each time i manipulate the copybook, I could go wrong somewhere and it could cause truncation in the data.
If there is no such option, its fine but I don't want to spend hours on building a REXX or SORT to do the conversion without knowing that an option already exists. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
sijayapal wrote: |
If there is no such option, its fine but I don't want to spend hours on building a REXX or SORT to do the conversion without knowing that an option already exists. |
But you don't mind spending two days hoping to get an answer here? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
sijayapal wrote: |
I tried it, it works but the problem is, the people i am dealing with has limited or no knowledge on mainframe. |
In that case, do they really care if the job has one or two steps ???
Here is another idea:
- Option 3.2 takes you to the Print Utility.
- Give the VSAM file name and the copybook,
- use Print Option 4 (Tabl),
- Copybook option 1 (Above)
- Select Batch Execution.
- Submit the job
- Check the beautiful report you've just created! |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
sija,
any follow up on this subject ? |
|
Back to top |
|
|
|