Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I have a cobol data file from a unisys A series mainframe. 2 types of fields : pic 9 (xx) comp. <= many fields of this type varying lengths pic X (15) . <= only one field I am having a problem translating the pic X (display field). I ftp'd file from mainframe as binary. Each record is 120 bytes. pic X field starts at byte 25 and the length is 15 bytes. I am using perl and unpack. When I did this: $string = unpack H240, $record the comp. fields come out fine and the display field is spit out in hex representation of EBCDIC which I can manually translate using a lookup table. ie: f3f4f2f4f1f9f8f7f8c3d4f0f0f0f1 = 342419878CM0001 But I want to automate this. I thought I was able to use an ebcdic2ascii function for this and translate the pic X field before being unpacked, but I am not getting the right answer.. Can someone help pls? I am a beginner with this translation stuff. To summarize, how do I translate a display field when file is ftp'd as binary? thanks a lot,
Post Follow-up to this messageIn article <1183131010.025069.104020@c77g2000hse.googlegroups.com>, roch77@gmail.com wrote: >Hi, >I have a cobol data file from a unisys A series mainframe. > >2 types of fields : > >pic 9 (xx) comp. <= many fields of this type varying lengths >pic X (15) . <= only one field > >I am having a problem translating the pic X (display field). > >I ftp'd file from mainframe as binary. Each record is 120 bytes. > >pic X field starts at byte 25 and the length is 15 bytes. > >I am using perl and unpack. > >When I did this: > >$string = unpack H240, $record >the comp. fields come out fine and the display field is spit out in >hex representation of EBCDIC which I can manually translate using a >lookup table. > >ie: f3f4f2f4f1f9f8f7f8c3d4f0f0f0f1 = 342419878CM0001 > >But I want to automate this. I thought I was able to use an >ebcdic2ascii function for this and translate the pic X field before >being unpacked, but I am not getting the right answer.. Some indication of what you *are* getting would be helpful... as well as som e indication of how you're going about it -- not to mention what platform you' re working on. > >Can someone help pls? I am a beginner with this translation stuff. > >To summarize, how do I translate a display field when file is ftp'd as >binary? With an ebcdic-to-ascii conversion. Without knowing what you're doing now, a nd how it's not working, it's pretty hard to advise you how to fix it. -- Regards, Doug Miller (alphagat milmac dot com) It's time to throw all their damned tea in the harbor again.
Post Follow-up to this message"Doug Miller" <spambait@milmac.com> wrote in message news:bQ9hi.23097$C96.793@newssvr23.news.prodigy.net... > In article <1183131010.025069.104020@c77g2000hse.googlegroups.com>, > roch77@gmail.com wrote: That should work, as long as that function is ONLY operating on the display fields and not the entire record. (Unpacking? What's to "unpack?" If file is FTPed it is not 'packed' it just 'is') (Third time in three ws for this *exact* same question here. Search archives, seems to me there have been at least 6,862 suggestions to solve your problem) MCM
Post Follow-up to this messageIn article <AX9hi.9363$c06.6434@newssvr22.news.prodigy.net>, Michael Mattias <mmattias@talsystems.com> wrote: [snip] >(Third time in three ws for this *exact* same question here. Search >archives, seems to me there have been at least 6,862 suggestions to solve >your problem) Maybe it's something in the water... used to be - back when they taught such things in schools - that the beginning of a new semester would bring folks asking The Same Question about getting their homework done; maybe there's been a recent flood of outsourcing that started with a magazine-article read by a Corner-Office Idiot which got translated into a sneering analysis of 'I don't see what's so difficult... all ya gotta do is...' DD
Post Follow-up to this messageroch77@gmail.com wrote: > Hi, > I have a cobol data file from a unisys A series mainframe. [snip] > I am having a problem translating the pic X (display field). > > I ftp'd file from mainframe as binary. Each record is 120 bytes. Are you sure you're getting EBCDIC? I know the 2200 used a 9-bit word, and straight binary FTP's dropped that 9th bit - you have to use "quote type l36" (or "quote type l 36", depending on your client) to enable 36-bit words. > ie: f3f4f2f4f1f9f8f7f8c3d4f0f0f0f1 = 342419878CM0001 Is this what's actually in the file on the mainframe? -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ / \/ _ o ~ Live from Albuquerque, NM! ~ ~ _ /\ | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Business E-mail ~ daniel @ "Business Website" below ~ ~ Business Website ~ http://www.djs-consulting.com ~ ~ Tech Blog ~ http://www.djs-consulting.com/linux/blog ~ ~ Personal E-mail ~ "Personal Blog" as e-mail address ~ ~ Personal Blog ~ http://daniel.summershome.org ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e h---- r+++ z++++ "Who is more irrational? A man who believes in a God he doesn't see, or a man who's offended by a God he doesn't believe in?" - Brad Stine
Post Follow-up to this messageLX-i wrote: > roch77@gmail.com wrote: > [snip] > > Are you sure you're getting EBCDIC? I know the 2200 used a 9-bit word, > and straight binary FTP's dropped that 9th bit - you have to use "quote > type l36" (or "quote type l 36", depending on your client) to enable > 36-bit words. > > > Is this what's actually in the file on the mainframe? > The A-Series (along with its Burroughs Large Systems predecessors and its Unisys successors) uses 8-bit EBCDIC characters. The original poster hasn't replied to Doug or posted anything else lately, so my guess is that the problem, whatever it was, is solved. Louis
Post Follow-up to this messageFree download from one of the best poorn galleries! http://girls-with-toys.info/gal218571
Post Follow-up to this message<roch77@gmail.com> wrote: > Hi, > I have a cobol data file from a unisys A series mainframe. > > 2 types of fields : > > pic 9 (xx) comp. <= many fields of this type varying lengths > pic X (15) . <= only one field > > I am having a problem translating the pic X (display field). > > I ftp'd file from mainframe as binary. Each record is 120 bytes. > > pic X field starts at byte 25 and the length is 15 bytes. > > I am using perl and unpack. > > When I did this: > > $string = unpack H240, $record > the comp. fields come out fine and the display field is spit out in > hex representation of EBCDIC which I can manually translate using a > lookup table. > > ie: f3f4f2f4f1f9f8f7f8c3d4f0f0f0f1 = 342419878CM0001 > > But I want to automate this. I thought I was able to use an > ebcdic2ascii function for this and translate the pic X field before > being unpacked, but I am not getting the right answer.. > > Can someone help pls? I am a beginner with this translation stuff. > > To summarize, how do I translate a display field when file is ftp'd as > binary? See: http://support.microsoft.com/kb/216399#appliesto At least that will give you the translation tables you need. -- Judson McClendon judmc@sunvaley0.com (remove zero) Sun Valley Systems http://sunvaley.com "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
Post Follow-up to this messageOn 29 Jun, 16:47, spamb...@milmac.com (Doug Miller) wrote: > In article <1183131010.025069.104...@c77g2000hse.googlegroups.com>, roc... @gmail.com wrote: > > > > > > > > > > > > Some indication of what you *are* getting would be helpful... as well as s ome > indication of how you're going about it -- not to mention what platform yo u're > working on. > > > > > > With an ebcdic-to-ascii conversion. Without knowing what you're doing now, and > how it's not working, it's pretty hard to advise you how to fix it. > > -- > Regards, > Doug Miller (alphagat milmac dot com) > > It's time to throw all their damned tea in the harbor again.- Hide quoted text - > > - Show quoted text - The US doesn't import much tea. Barely worth the gesture.
Post Follow-up to this messageIn article <1184092446.631998.166940@57g2000hsv.googlegroups.com>, Alistair <alistair@ld50macca.demon.co.uk> wrote: [snip] >The US doesn't import much tea. I'm not sure how 'much' is quantified here, Mr Maclean... according to http://hi.baidu.com/zuileya/blog/it...cad1c86ae7.html , total tea imports into the US are 91,299,495 95,706,100 kilos. DD
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.