× 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.



Hi Everyone,

One of my customers has a program that does

CPYTOIMPF FROMFILE(QTEMP/HPTHPLAN)
TOSTMF('/home/HPTHPLAN.txt')
RCDDLM(*CRLF)
STRDLM(*NONE)
RMVBLANK(*BOTH)
FLDDLM(*TAB)

They're on v6r1, and the interesting thing is that even though the command has RMVBLANK(*BOTH), and the default of DTAFMT(*DLM), the resulting file simply has trailing x'00' instead of x'40' (blanks). For example, this record

Record# Plan Plancode Payorcode Trim ( Planname ) Null1
1 PLAN MS4_Adjustment MS4_Adjustment MS4_Adjustment
DDCD4444 DEF6C89AAA989A44444444444 DEF6C89AAA989A44444444444 DEF6C89AAA989A4444444444444444 4
73150000 424D141423455300000000000 424D141423455300000000000 424D14142345530000000000000000 0

is copied as

P L A N M S 4 _ A d j u s t m e n t M S 4 _ A d j u s t m e n t
D7D3C1D5 00000000 05D4E2F4 6DC18491 A4A2A394 8595A300 00000000 00000000 000005D4 E2F46DC1 8491A4A2 A3948595 A3000000
M S 4 _ A d j u s t m e n t CrLf
00000000 00000000 0005D4E2 F46DC184 91A4A2A3 948595A3 050D25

If I change the command to

CPYTOIMPF FROMFILE(QTEMP/HPTHPLAN)
TOSTMF('/home/HPTHPLAN.1.txt')
RCDDLM(*CRLF)
STRDLM(*NONE)
RMVBLANK(*NONE)
FLDDLM(*TAB)

I get trailing x'40' (blanks) and that first record above is copied as

P L A N M S 4 _ A d j u s t m e n t M S 4 _ A d j u s t m e n t
D7D3C1D5 40404040 05D4E2F4 6DC18491 A4A2A394 8595A340 40404040 40404040 404005D4 E2F46DC1 8491A4A2 A3948595 A3404040
M S 4 _ A d j u s t m e n t CrLf
40404040 40404040 05D4E2F4 6DC18491 A4A2A394 8595A305 0D25

I know that CPYFRMIMPF and CPYTOIMPF have had issues in the past, but I thought they'd settled down, and indeed on v5r4 this was working as expected.

I know the workarounds, writing an RPG program to do the copy or even using CPYTOSTMF after building the data in a physical file, but really, it just seems sad that they can't get this utility command working and then leave it alone.

--*
Peter Dow*/
Dow Software Services, Inc.
909 793-9050
pdow@xxxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxxx> /


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.