ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

get EDTWRD or EDTCDE

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • get EDTWRD or EDTCDE

    Hi,

    i would like to know how to get the EDTCDE from EDTWRD through RPGLE from a field?

    for example, i have a field with ':' as EDTCDE, which '0 : : ' as EDTWRD and whenever there is a value of 6 character will be '12:34:56'

    i would like to retrieve the EDTCDE value. also, the fields type and other information of a field.

    Thanks.

    Windy
    "Nothing is impossible in coding. If the logic exist in this world, so as programming world. All we need it the bravery to ask others for help and a thanks for all the gifts received"

  • #2
    Re: get EDTWRD or EDTCDE

    PHP Code:
                                                                                    
         d my50            s             50    inz
    (*all'X')                         
         
    d my4             s              4  0 inz(1000)                            
         
    d count           s              4  0                                      
                                                                                    
         d FILEARRAY       DS                                                       
         d theWholeTomato                54     dim
    (10ascend inz(*hival)          
         
    d  SEQUENCE                      4S 0  Overlay(thewholetomato:1)           
         
    d  NOTES                        50A    Overlay(thewholetomato:*next)       
                                                                                    
                                                                                    
                                                                                    
    12345 /free                                                                     
           
    for count 1 to 10;                                                     
            
    my4 += count;                                                           
            
    thewholetomato(count) = %editc(My4:'X')  + my50;                        
           endfor;                                                                  
           *
    inlr = *on
    PHP Code:
       d count           s              3  0                                  
       d datalength      s              3  0                                  
       d fnd             s              3  0                                  
       d mydata          s             30                                     
       d str             s              3  0                                  
       d decimaldata     s              7  2 inz
    (2548.99)                     
        /
    free                                                                 
             mydata 
    '00000.34';                                             
             
    datalength = %len(%trim(mydata));                                
             
    str 1;                                                         
             for 
    count 1 to datalength;                                     
              if %
    subst(mydata:str:1) > '0' or                                
                 %
    subst(mydata:str:1) = '.';                                  
               
    leave;                                                         
              endif;                                                          
              
    str +=1;                                                        
             endfor;                                                          
             
    mydata = %subst(mydata:str);                                     
              
    dsply mydata ' ';                                               
                                                                                
               
    // what %char does against what %editc(&xx:'X') does             
               // %char removes all leading *zeros this is why its              
               // bad when messin with dates : ss# .....etc                     
                                                                                
               
    dsply  %char(decimaldata' ';                                   
               
    dsply  %editc(decimaldata:'Z');                                  
               
    dsply  %editc(decimaldata:'X');                                  
               
    dsply  %editc(decimaldata:'J');                                  
               
    dsply  %editc(decimaldata:'L');                                  
               
    dsply  %editc(decimaldata:'M');                                  
                *
    inlr = *on;                                                    
         /
    end-free 
    PHP Code:
    worktitle50 =  'Date Range :' + %editw(p1monday:'  /  /  ') +    
                   
    ' to ' + %editw(p1friday:'  /  /  '); 
    PHP Code:
       c                   if        maphon <> *zero                                          
       c                   
    eval      Phone1 = %editw(maarea:'   ') +                          
       
    c                                '/' + %editw(maphon:'   -    ')                       
       
    c                   endif                                                              
                                                                                              
       
    c                   if        maphon2 <>  *zero                                        
       c                   
    eval      Phone2 = %editw(maarea2:'   ') +                         
       
    c                                '/' + %editw(maphon2:'   -    ')                      
       
    c                   endif 
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: get EDTWRD or EDTCDE

      Originally posted by Windy Chia

      i would like to retrieve the EDTCDE value. also, the fields type and other information of a field.


      Windy
      If you tell us _why_ you want to do this it would be so much easier to offer a suggestion. Do you want to extract information from a file? Printer file? Display file? From the usage with an RPG program?

      Comment


      • #4
        Re: get EDTWRD or EDTCDE

        actually i want to read the value to use it for my maintenance log, which store in PF then display out again in screen later on.

        for future use, i just want to know how to extract all the information, whether to store or to display out. maybe needed in future.

        thanks ya.
        "Nothing is impossible in coding. If the logic exist in this world, so as programming world. All we need it the bravery to ask others for help and a thanks for all the gifts received"

        Comment


        • #5
          Re: get EDTWRD or EDTCDE

          From where? Are you looking to be able to perform some kind of introspection on the program to ask what edit codes/words are in use?

          Are you looking to see what edit code/word is used in a print file?

          To be honest whether you are logging it or not it doesn't make an awful lot of sense. Can you tell us more about the "why".

          "... know how to extract all the information ..." from what? Every type of object on the system can be interrogated to some degree and information extracted - but it varies by object type.

          Comment


          • #6
            Re: get EDTWRD or EDTCDE

            well... this is what i want, whenever i done a program, i will be logging a maintenance log. whatever i changed in a record in the PF, i will send which fields changed/modified to the maintenance log. inside maintenance log, need to know the field name, description, and any other possible information of that fields to store into the maintenance log.

            hope i got it clear this time.

            p.s. i found out that the DSPFFD command can help me get all the relevent value if i read the files. just taught if there are other ways to do so or not or more simpler way like API or CLLE command or like jamief suggestion, another program. oh ya, thanks jamief.
            "Nothing is impossible in coding. If the logic exist in this world, so as programming world. All we need it the bravery to ask others for help and a thanks for all the gifts received"

            Comment


            • #7
              Re: get EDTWRD or EDTCDE

              It seems a pretty pointless exercise because you are then just duplicating what you have documented in the source.

              Nevertheless, this will display all your changed or added lines of source as from a given date.
              Code:
              cl: OVRDBF FILE(QRPGLESRC) TOFILE(DVB01S1/QRPGLESRC) MBR(OEP65TRG) OVRSCOPE(*JOB) ;
              SELECT * FROM DVB01S1/QRPGLESRC
              where srcdat >= 110124;
              Regards

              Kit
              http://www.ecofitonline.com
              DeskfIT - ChangefIT - XrefIT
              ___________________________________
              There are only 3 kinds of people -
              Those that can count and those that can't.

              Comment

              Working...
              X