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



        Thanks  Keith  ...now its wokring
        Regards,
        Murali

> -----Original Message-----
> From: keith_mccully@wunderman.co.uk [SMTP:keith_mccully@wunderman.co.uk]
> Sent: Tuesday, January 21, 2003 3:59 PM
> To:   RPG programming on the AS400 / iSeries
> Subject:      Re: MODS
> 
> 
> 
> 
> >DHDRTBLMODS       DS                  OCCURS(100)
> >DIhdr_Rec_Typ            1      1A
> >DIhdr_as_len                2      3
> >DIhdr_hosp_cod           4      6
> >DIhdr_gr_fil                  7     16A
> >DIhdr_fil_nam             17     26A
> >DIhdr_cnt                  27     35s 0
> >DIhdr_int_flg             36     36A
> >DIhdr_f_spac            37     69A
> >DIhdr_upd_dat           70     77A
> >DIhdr_upd_tim           78     83A
> 
> 
> >EVAL      Hdr_hosp_cod = Ihdr_hosp_cod(1)......
> 
> >I want to set the value of Hdr_hosp_code with    first index of
> >Ihdr_hosp_code..will the above statement does the help for me?
> 
> Murali,
> 
> No. You have defined HDRTBLMODS as a multi occurrence data structure with
> 100 occurrences. However, in your EVAL statement, you treat
> Ihdr_hosp_cod(1) as an array element - which it is not, it is a data
> structure sub field.
> 
> For the above case, you need the OCCUR op code. This will set the data
> structure to the correct occurrence BEFORE you do any data manipulation.
> 
> 
> 1          OCCUR     HDRTBLMODS
> 
>            EVAL      Hdr_hosp_cod = Ihdr_hosp_cod
> 
> Alternativly, set the OCCUR factor 1 to an numeric index field of length
> 3,0 and then set this to 1.
> 
>            EVAL      indVar = 1
> 
> indVar     OCCUR     HDRTBLMODS
> 
>            EVAL      Hdr_hosp_cod = Ihdr_hosp_cod
> 
> I don't know your setup but typically you could iterate thru the data
> structure by putting the OCCUR and EVAL within a loop and setting the
> index
> variable, indVar, to an incrementing loop counter.
> 
> Keith
> 
> PS. Please do not include replies to previous threads in a new post.
> 
> 
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo.cgi/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
WARNING: The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee.  Access to this message
by anyone else is unauthorised.  If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error. Thank you.

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.