- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unpack COBOL packed fields during FTP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2002 11:25 AM
тАО06-12-2002 11:25 AM
Has anyone had any experience in transmitting files with this type of field to HP-UX 11.0 that would change the comp 3 to an unsigned.
If not via ftp, then once the file arrives is there a utility to unpack only those fields.
Note: This is not a zipped file. Only fields within the file are packed.
Appreciate any input.
dl
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2002 11:32 AM
тАО06-12-2002 11:32 AM
SolutionAlthough I do not know of any pre-built utility, "perl" is quite capable of parsing text data (see pack/unpack function).
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2002 11:33 AM
тАО06-12-2002 11:33 AM
Re: Unpack COBOL packed fields during FTP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2002 11:36 AM
тАО06-12-2002 11:36 AM
Re: Unpack COBOL packed fields during FTP
The last time I tried to do something in perl it appeared we do not have it installed.
Will note your answer and assign
mega points shortly.
Thanks again.
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2002 12:01 PM
тАО06-12-2002 12:01 PM
Re: Unpack COBOL packed fields during FTP
get perl from here:
http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.6.1/
Remember that you have to use BINARY mode to transfer the files in ftp.
If the file is in EBCDIC, you can convert it to ascii using "dd" and the "conv ascii" or "conv ibm" option.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2002 03:57 PM
тАО06-12-2002 03:57 PM
Re: Unpack COBOL packed fields during FTP
I was afraid there was no esay solution.
No wonder "everyone is not doing this" .....
Thanks again.
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2002 04:14 PM
тАО06-12-2002 04:14 PM
Re: Unpack COBOL packed fields during FTP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2002 04:23 PM
тАО06-12-2002 04:23 PM
Re: Unpack COBOL packed fields during FTP
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2002 09:40 AM
тАО06-13-2002 09:40 AM
Re: Unpack COBOL packed fields during FTP
Thanks for the encouragement for an old time mainframe systems programmer trying to get into the
90's.
Bill -
That's great news. Looking like I'll be learning another tool.
"Never too old .... "
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2002 12:01 PM
тАО06-13-2002 12:01 PM
Re: Unpack COBOL packed fields during FTP
My recommendation is to first write a tool that reads in the ibm file and builds two files. The first will have the comp-3 fields (or other binary like comp-6) and the other the EBCDIC data.
Then you can use "dd" to convert ebcdic to ascii on the second file. The first file will require another program to translate the binary to ascii representations. That same program can then merge back in the first file.
I assume you do not have access to the programs/system that generated the original file. If you did then it would be easier to have convert the comp-3 fields.
My 2 cents.
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2002 12:24 PM
тАО06-13-2002 12:24 PM
Re: Unpack COBOL packed fields during FTP
It seems to be easier to do from the mainframe side, since they already have the record descriptions programmed in COBOL, PL/1 or whatever they have been using, and can much more simply output the data in text format.
In UNIX, the packed decimal format is not used, so it would be a nasty conversion of bit shifting.
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2002 12:27 PM
тАО06-13-2002 12:27 PM
Re: Unpack COBOL packed fields during FTP
putting on my cobol hat - you are right, that's what I used to do, plus they could seperate the fields by building a new record using a filler of ";" and doing a "move like".
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2002 12:32 PM
тАО06-13-2002 12:32 PM
Re: Unpack COBOL packed fields during FTP
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2002 01:00 PM
тАО06-13-2002 01:00 PM
Re: Unpack COBOL packed fields during FTP
Yeh, I've gotta love your answer because it is the easiest for me with the exception of the fact we
are running both environments and the program is still in use.
So .... copy it, make my changes,
catalog as new prog and add a step to the driver proc.
I just didn't want to have to perform this on all interface programs.
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2002 01:02 PM
тАО06-13-2002 01:02 PM
Re: Unpack COBOL packed fields during FTP
Ditto my answer to Rodney.
Harry -
Thanks for the confirmation.
Thanks people.
Like to close this thread now.
Thanks again.
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 09:37 PM
тАО07-31-2002 09:37 PM
Re: Unpack COBOL packed fields during FTP
2) Unblock the file and set the record length :
dd if=(infile) of=(outfile) cbs=(reclength) conv=unblock
3) Load the file to to your Oracle8i database using sql*loader. Your control file should look like this: :
Load data
characterset we8ebcdic500
infile '/mims/den/mims_run_t/work/jmc.ldi2'
badfile '/mims/den/mims_run_t/work/jmcjobldi.bad'
Append into table JMC_JOB
(APPL_NBR position(5:11) char "'E'||:APPL_NBR",
JOB position(1:12) char,
SITE_RESP position(13:15) DECIMAL(5,2),
EST_CHG_DEP position(42:46) DECIMAL(9,2),
EST_CHG_CONN position(47:51) DECIMAL(9,2),
EST_CHG_PRIV position(52:56) DECIMAL(9,2),
EST_CHG_PUB position(57:61) DECIMAL(9,2),
EST_CHG_PAFC position(62:66) DECIMAL(9,2),
EST_CHG_XDEP position(67:71) DECIMAL(9,2),
PD_CHG_DEP position(72:76) DECIMAL(9,2),
PD_CHG_CONN position(77:81) DECIMAL(9,2),
PD_CHG_PRIV position(82:86) DECIMAL(9,2),
PD_CHG_PUB position(87:91) DECIMAL(9,2),
PD_CHG_PAFC position(92:96) DECIMAL(9,2),
PD_CHG_XDEP position(97:101) DECIMAL(9,2),
PD_DTE_DEP position(102:109) char,
PD_DTE_CONN position(110:117) char,
PD_DTE_PRIV position(118:125) char,
PD_DTE_PUB position(126:133) char,
PD_DTE_PAFC position(134:141) char,
PD_DTE_XDEP position(142:149) char,
DTE_VOUCHER position(584:591) char,
EST_CHG_VAT position(592:595) DECIMAL(7,2),
PD_CHG_VAT position(596:599) DECIMAL(7,2),
PD_DTE_VAT position(600:607) char
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2002 05:44 AM
тАО08-02-2002 05:44 AM
Re: Unpack COBOL packed fields during FTP
Thanks for the input. As I mentioned, I will not be back in the shop for another 2-3 weeks and will give it a shot then.
Presently, we are just changing the progs to output two files, one for the mainframe and a sequential(flat) for unix.
If I can incorporate your suggestion we can script this from the unix side for the said problem.
Thanks again.
dl