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



Hey Bill

Assumption is correct. I do like using functions, and will look at this.

Performance could be slower than my original idea, but this doesn't happen a lot - it's one at a time in an add/change program.

Thanks
V.

On 8/17/2013 10:47 AM, Bill Wragg wrote:
I am getting that these are dates:
8,0 is a ccyymmdd
6,0 is a yymmdd

// mmddyy to yymmdd
@numA = %dec(%char(%date(@numD:*mdy):*ymd0):6:0);

Converts numeric ccyymmdd to numeric yymmdd

Good Luck
Bill
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Vernon Hamberg
Sent: August 17, 2013 11:40 AM
To: RPG programming on the IBM i / System i
Subject: Want to replace MOVE numeric 8 to numeric 6 in free form

I've a zoned 8,0 that is being MOVEd to a packed 6,0. I want to convert this
to free form.

I can think of putting the zoned 8,0 into a data structure with a zoned
6,0 overlaying the last 6 positions, then use an assignment statement.

In the following, I wanted to use CNVDAT instead of CNVDT8. That can work
with fields from a file, didn't work so far, so will use an assignment of
CNVDT8 = CNVDAT for now.

* Allow "MOVE" of 8-digit ot 6-digiy
D DATE8TO6 DS
D CNVDT8 8s 0
D CNVDT6 6S 0 overlay(DATE8TO6 : 3)

Then CNVDT6 should have the value I want - this is 8-digit dates to 6-digit
in YMD format.

Is there a better way? I looked at several articles - Bob Cozzi, Jon Paris,
some other forums - none that I saw dealt with the MOVE from a longer
numeric to shorter.

TIA
Vern
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.