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



On 11/25/2014 6:07 PM, Hoteltravelfundotcom wrote:
HI I have to create a file based on employee badge info.

there is name and dept 40 characters each.

the badge id is 3 but they want the PF to hold 8 for futures.

when I created the field as 8 character, it adds leading zeros

What is the 'it' which adds leading zeroes? I have created tens of
thousands of character fields both in DDS and in SQL and I have never
seen leading zeroes unless a program puts them there.

so I made
the field numeric 8S 00 but they want it to be character.

Any ideas how to copy without throwing in the leading zeros? I think an RPG
program would be the way but is there any way in a CL or Command?

CPYF FMTOPT(*MAP)

Of course, we'd be able to give you a better answer if you would post
some code. The DDS of the original file and your new file as well as
whatever 'it' is that you tried, which added the leading zeroes. Here
is one way to do that:

create table buck/small (badgeid char(3))
create table buck/large (badgeid char(8))

insert into buck.small (badgeid) values('AAA')
insert into buck.small (badgeid) values('BBB')
insert into buck.small (badgeid) values('C')
select * from buck.small
BADGEID
-------
AAA
BBB
C

cpyf buck/small buck/large mbropt(*replace) fmtopt(*map)
3 records copied from member SMALL.

select * from buck.large
BADGEID
--------
AAA
BBB
C


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.