× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm a C newbie, and have a couple questions that I hope
someone can help me out with.  I want to read data from
a file and write it to another file.

I can open the files, read the input file, and write to
the output file.  The packed data I'm having trouble
with.

The input file has one 32 pos field, and a string of
fixed-width data.  The output file has many character
fields, and a couple packed fields.  For the packed
fields (for now - I'll worry about converting the
character to packed later), I am doing this:

 record_OUT.DHUBNBR = (decimal(4,0))0D;

I am moving the characters to the output fields using
strcpy.  This is when the problem shows up.  The packed
fields wind up with blanks and all the character fields
beyond the first packed field are missing 1 character.

Going through debug everything looks good until this
step is done, and I look again at record_OUT.

Here's my mapinc statement for my output file:

#pragma mapinc("OUTFILE","*LIBL/OUTFILE(*all)","both","d
_P",," ")

Thanks for your help!,

Phil


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.