- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: file conversion using dd
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
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
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
04-10-2003 12:01 AM
04-10-2003 12:01 AM
file conversion using dd
I have a file that has the following block size and record length
REMOTE_SYSTEM_TYPE=MVS
RECORD_LENGTH=32756
BLOCK_SIZE=32760
The file has come from remote VMS and looks as though it has been blocked for space purposes.
It comes through as awk program text as the HP doesn't know what type of file it is
PROD.tsysuk-edouk-stmts.20030307231003: awk program text
I am trying to convert the file to ascii using dd with the following permitations
dd if=PROD.tsysuk-edouk-stmts.20030307231003 conv=ascii bs=32760 of=ste.new
dd if=PROD.tsysuk-edouk-stmts.20030307231003 conv=ascii cbs=32760 of=ste.new
dd if=PROD.tsysuk-edouk-stmts.20030307231003 conv=ascii bs=110 of=ste.new
dd if=PROD.tsysuk-edouk-stmts.20030307231003 conv=ascii cbs=110 of=ste.new
Plus others. The cbs=110 is giving me some readable text but not enough.
Can anyone advise further ?
Thanks in advance
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 12:09 AM
04-10-2003 12:09 AM
Re: file conversion using dd
try your first attempt again, but use ibs=32760 as opposed to bs=32760
More often than not, this is a long drawn out play with all hte variables until you get what you want out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 12:55 AM
04-10-2003 12:55 AM
Re: file conversion using dd
Struggling -
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 01:16 AM
04-10-2003 01:16 AM
Re: file conversion using dd
dd if=PROD.tsysuk-edouk-stmts.20030307231003 conv=ascii ibs=32760 cbs=32756 of=ste.new
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 01:30 AM
04-10-2003 01:30 AM
Re: file conversion using dd
Some ascii char but the rest is just control characters
Thanks
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 01:54 AM
04-10-2003 01:54 AM
Re: file conversion using dd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 02:36 AM
04-10-2003 02:36 AM
Re: file conversion using dd
A long time ago I had to play this kind of game ... But I don't known VMS. Are you sure source coding is EBCDIC ? Sometimes I also had to play with conv=swab (to swap bytes) or conv=unblock to convert from fixed-length to variable-length.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 03:01 AM
04-10-2003 03:01 AM
Re: file conversion using dd
What is it you want to achieve? Read blocks of 32760 bytes, strip trailing spaces and write to (ASCII) file with newlines instead?
can you make the first 100k of the file available as URL, so we can have a look? I bet it's doable with perl, whatever you want to achieve :]
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 03:18 AM
04-10-2003 03:18 AM
Re: file conversion using dd
If this is the case, then the first 2 bytes of each block will hold the binary length of the block, and then each record within the block will have a 2 byte binary record length at the beginning. In each case the third and fourth bytes should be zero (they are used for something, but it's so long since I did anything with these records that I can't remember what). Each record can be up to 32756 bytes, but could be much shorter.
Sorry, I don't know if there is any standard utility on HP-UX which will re-block them.
How did you get the data? Was it ftp'd from an MVS mainframe? If so there should be some options on the ftp transfer that might allow reblocking. A 'help site' in ftp might provide assistance.
HTH
Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 03:50 AM
04-10-2003 03:50 AM
Re: file conversion using dd
#perl -le'while(read STDIN,$_,32760){print unpack"s/a",$_}' file.vms >file.txt
variations of s/a to n/a or v/a (big- vs. little-endian numbers) could help
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 04:47 AM
04-10-2003 04:47 AM
Re: file conversion using dd
Thanks for all your input. I have had a really busy morning , will try out your suggestions this afternoon and get back to you
Thanks again
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 06:49 AM
04-10-2003 06:49 AM
Re: file conversion using dd
And yes - it's from mvs , not vms (doh!) and variable blocked ebcidic
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 06:56 AM
04-10-2003 06:56 AM
Re: file conversion using dd
I get
syntax error in file /tmp/perl-ea00561 at line 1, next 2 tokens "read STDIN"
Execution of /tmp/perl-ea00561 aborted due to compilation errors.
Any advice ?
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 07:00 AM
04-10-2003 07:00 AM
Re: file conversion using dd
Zq??????????????????????^Qb^A^W^A^G????^N??(^B^A??????????????K??????K????????K??????????K????????K??????K????????(^B??????????????K??????K????????K??????????K????????K??????K????????Z^\??????????????????????
!AZ'????^A????????????????^Qb@??????????????????????????^Fc^AZ2????^C??????????????????????????@{??@@@@@@@@@@@@@@@@^H??^B??^A??Z^U????^D????????????????
I have just spoken to the sender of the file, they have advised that it is a 'print image file'
a goose chase springs to mind
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 07:04 AM
04-10-2003 07:04 AM
Re: file conversion using dd
Guess it proved an interesting thread though ;-]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2003 07:19 AM
04-10-2003 07:19 AM
Re: file conversion using dd
There was a previous online tranaslation done when transmited?
1- It is a tape:
dd if=file_vms of=file_ux bs=32760
# no conversion is done.
The output form this command must be
xxx+0 records in
xxx+0 records out
2- It is ftp'd:
strings file_ux
if you can read any fragment, the file should be previously translated.
And no translation is needed.
Attach the first KB, it you can do it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2003 12:20 AM
04-11-2003 12:20 AM
Re: file conversion using dd
What version of perl do you use? [ perl4 from /usr/contrib/bin is not good enough ;) ]
what does 'file file.vms' tell you?
is it packed? compressed? encoded?
give us a hex dump of the first 64 bytes.
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2003 01:49 AM
04-11-2003 01:49 AM
Re: file conversion using dd
!M-;LyFM-^?M-^?M-^?M-^?M-^?M-^?M-^?M-^?;M-)M-2;M- ;M-/;M- ;M-&7M-Q;+M-`M-^H;M-!;
M- CPW2520.INH.I001.F0001.ACIF.RES.TEMPM-^H;M-!CPW2520.INH.I001.F0001.ACIF.OUT.T
EMP!;*LyM-lT1V10500M-^NM-^AM- !^WM-^CM-^SM-^YM-^[Ly;M- T1V10500;M-)M-2 943
5000000000;M-%M-3;M- !^VLw;M-"INTERNATIONAL #5 ;M-'M-g;M-!M-a;
M- 4!;M--Lx;M-#SP010000M-^N
Which has some readable text in it, so that confirms that the source was EBCDIC, but if the data is a print data stream then it will consist of both text and binary data, so any conversion to ASCII is doomed to failure.
Ian