×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Thanks again

Char 70A  file is 36 fields of FXSQ01,FXSQ02,etc.

Num File with 12 Qtys for a year.  exp. SSFile

Start Year 2 years back.

So  would I then use what you have but add. 

D                 DS
D FXQS                          70A  Dim(36)
D  FXQS01                            Overlay(FXQS:1)
D  FXQS02                            Overlay(FXQS:*next)
    .
    .
    .
D   FXQS36                           Overlay(FXQS:*next)

D                 DS
D SSQS                          15S 0Dim(12)
D  SSQS01                           Overlay(SSQS:1)
D  SSQS02                           Overlay(SSQS:*next)
    .
    .
    .
D  SSQS36                           Overlay(SSQS:*next)


D                 DS
D  WQTY                   1     15A
D  WQTYN                  1     15S 0

D  y              S              5U 0
D  x              S              5U 0

                  Eval      StartYear   = %subdt(%date() -
                 %years(3):*Y)    
 
       *loval Setll     CHAR 70A 
                  Read      CHAR 70A
                  Dow       Not %Eof
 
                  Eval      x = 1
 
                  Select
 
 
                  When      SSFile Year  =    StartYear
                  Eval      y = 1
 
 
                  When  SSFile Year  =    StartYear + 1
                  Eval      y = 13
 
 
                  When  SSFile Year  =    StartYear + 2
                  Eval      y = 25

                  Endsl


              DoW       x <= 12 
 
              Clear                   WQTY
              EvalR     WQTY = %trimr(FXQS(y))
' ':'0'       Xlate     WQTY          WQTY
              Eval      WQTYN = WQTYN + SSQS(X)
              Eval      FXQS(y) = %triml(%editc(WQTYN:'4'))
 
                  Eval      x = x + 1
                  Eval      y = y + 1
 
              EndDo

                  Update Char 70A file record
                  Read      CHAR 70A
                  Enddo

Thanks 
Bill Hopkins

 




"Johnson, Duane" <djohnson@xxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
08/14/2003 03:36 PM
Please respond to RPG programming on the AS400 / iSeries

 
        To:     "'RPG programming on the AS400 / iSeries'" 
<rpg400-l@xxxxxxxxxxxx>
        cc: 
        Subject:        RE: Character to Numeric can it be cleaned up


In that case, how about something like this? 

D                 DS
D FXQS                          70A  Dim(36)
D  FXQS01                            Overlay(FXQS:1)
D  FXQS02                            Overlay(FXQS:*next)
    .
    .
    .
D   FXQS36                           Overlay(FXQS:*next)

D                 DS
D SSQS                          15S 0Dim(12)
D  SSQS01                           Overlay(SSQS:1)
D  SSQS02                           Overlay(SSQS:*next)
    .
    .
    .
D  SSQS36                           Overlay(SSQS:*next)


D                 DS
D  WQTY                   1     15A
D  WQTYN                  1     15S 0


D  x              S              5U 0

              Eval      x = 0
              DoW       x < 12 
              Eval      x = x + 1
              Clear                   WQTY
              EvalR     WQTY = %trimr(FXQS(x))
' ':'0'       Xlate     WQTY          WQTY
              Eval      WQTYN = WQTYN + SSQS(X)
              Eval      FXQS(x) = %triml(%editc(WQTYN:'4'))
              EndDo
 
or something along those lines.  I don't remember if you can now do a For 
-
EndFor in normal RPG.  If so, that would probably be more appropriate than
the DoW that I have here.

Duane


> -----Original Message-----
> From:          Bill Hopkins [SMTP:BHopkins@xxxxxxxxxxxxxxxxxxx]
> Sent:          Thursday, August 14, 2003 1:06 PM
> To:            RPG programming on the AS400 / iSeries
> Subject:               Re: Character to Numeric can it be cleaned up
> 
> Thanks Duane and Buck,
> 
> I have Char FXQS?? 70 A buckets 1 thru 36  the SSQS?? 1 thru 12  is 15s 
0
> 
> Char field starts left justified and  has to end left justified 
> 
> So I build "sorry to say" subroutine not procedure to 
> 
> exsr and do this:
> 
> Eval      WQTY   = FXQS01
> Eval      NQTY2  = SSQS01
> Exsr      CalBucket 
> Eval      FXQS01 = WQTY 
> 
> Eval      WQTY   = FXQS02
> Eval      NQTY2  = SSQS02
> Exsr      CalBucket 
> Eval      FXQS02 = WQTY 
> 
> etc.
> 
> CalBucket  Begsr
> 
> Evalr     WQTY  = %trimr(WQTY) 
> MOVE   WQTY          NQTY1 
> Eval      WQTY = %triml(%editc((NQTY1 + NQTY2):'4'))
> 
> Endsr
> 
> Thanks 
> 
> Bill Hopkins
> _______________________________________________
> This is the RPG programming on the AS400 / 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.
_______________________________________________
This is the RPG programming on the AS400 / 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 ...


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

This mailing list archive is Copyright 1997-2026 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.