ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

data area command

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

  • data area command

    which command to use for checking that if data area already exist in Library.

  • #2
    Re: data area command

    Chkobj

    Comment


    • #3
      Re: data area command

      @vikramx

      actually i failed to put my question right at the first time,

      I want to check that if data area exist by a code

      like

      if (data area exist) then (do)
      -------------
      -------------
      ------------
      enddo

      sort of thing.

      Comment


      • #4
        Re: data area command

        Code:
        chkobj mylib/mydtaara *dtaara
        monmsg cpf0000 exec(do)
         /* it ain't there */
        enddo
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment


        • #5
          Re: data area command

          if needed in RPG you can mod and update this
          Code:
              H Option(*SrcStmt: *NoDebugIO) DftActGRP(*No)                                                  
               ‚*                                                                                             
               ‚* Program Info                                                                                
               ‚*                                                                                             
               d                SDS                                                                           
               d  @PGM                 001    010                                                             
               d  @PARMS               037    039  0                                                          
               d  @MSGID                40     46                                                             
               d  @MSGDTA               91    170                                                             
               d  @JOB                 244    253                                                             
               d  @USER                254    263                                                             
               d  @JOB#                264    269  0                                                          
               ‚*                                                                                             
               ‚*  Field Definitions.                                                                         
               ‚*                                                                                             
               d ISOdate         S               D                                                            
               ‚*                                                                                             
               ‚* Check name unique when add save processed (F6)                                              
               ‚*                                                                                             
               d CheckObject     S             19    Dim(9999)                                                
               ‚*                                                                                             
               ‚* Some working environment                                                                    
               ‚* ~~~~~~~~~~~~~~~~~~~~~~~~                                                                    
               D ObjNam          s             10a                                                            
               D ObjLib          s             10a                                                            
               D ObjTyp          s             10a                                                            
               **-- Api error data structure:  ----------------------------------                             
               D ApiError        Ds                                                                           
               D  AeBytPro                     10i 0 Inz( %Size( ApiError ))                                  
               D  AeBytAvl                     10i 0 Inz                                                      
               D  AeMsgId                       7a                                                            
               D                                1a                                                            
               D  AeMsgDta                    128a                                                            
               **-- Object description structure OBJD0200:  ---------------------                             
               D RoData          Ds                                                                           
               D  RoBytRtn                     10i 0                                                          
               D  RoBytAvl                     10i 0                                                          
               D  RoObjNam                     10a                                                            
               D  RoObjLib                     10a                                                            
               D  RoObjTypRt                   10a                                                            
               D  RoObjLibRt                   10a                                                            
               D  RoObjASP                     10i 0                                                          
               D  RoObjOwn                     10a                                                            
               D  RoObjDmn                      2a                                                            
               D  RoObjCrtDts                  13a                                                            
               D  RoObjChgDts                  13a                                                            
               D  RoExtAtr                     10a                                                            
               D  RoTxtDsc                     50a                                                            
               D  RoSrcF                       10a                                                            
               D  RoSrcLib                     10a                                                            
               D  RoSrcMbr                     10a                                                            
               **-- Retrieve object description:  -------------------------------                             
               D RtvObjD         Pr                  ExtPgm( 'QUSROBJD' )                                     
               D  RoRcvVar                  32767a         Options( *VarSize )                                
               D  RoRcvVarLen                  10i 0 Const                                                    
               D  RoFmtNam                      8a   Const                                                    
               D  RoObjNamQ                    20a   Const                                                    
               D  RoObjTyp                     10a   Const                                                    
               D  RoError                   32767a         Options( *VarSize )                                
               ‚*                                                                                             
               dTheData          DS                                                                           
               ‚*                                                                                             
               ‚* Bytes Return                                                                                
               ‚*                                                                                             
               d QUSBR05                 1      4B 0                                                          
               ‚*                                                                                             
               ‚* Bytes Avail                                                                                 
               ‚*                                                                                             
               d QUSBA05                 5      8B 0                                                          
               ‚*                                                                                             
               ‚* Job Name                                                                                    
               ‚*                                                                                             
               d QUSJN08                 9     18                                                             
               ‚*                                                                                             
               ‚* User Name                                                                                   
               ‚*                                                                                             
               d QUSUN07                19     28                                                             
               ‚*                                                                                             
               ‚* Job Number                                                                                  
               ‚*                                                                                             
               d QUSJNBR07              29     34                                                             
               ‚*                                                                                             
               ‚* Int Job ID                                                                                  
               ‚*                                                                                             
               d QUSIJID05              35     50                                                             
               ‚*                                                                                             
               ‚* Job Status                                                                                  
               ‚*                                                                                             
               d QUSJS14                51     60                                                             
               ‚*                                                                                             
               ‚* Job Type                                                                                    
               ‚*                                                                                             
               d QUSJT08                61     61                                                             
               ‚*                                                                                             
               ‚* Job Subtype                                                                                 
               ‚*                                                                                             
               d QUSJS15                62     62                                                             
               ‚*                                                                                             
               ‚* Job Switch                                                                                  
               ‚*                                                                                             
               d QUSJS16                63     70                                                             
               ‚*                                                                                             
               ‚* End Status                                                                                  
               ‚*                                                                                             
               d QUSES00                71     71                                                             
               ‚*                                                                                             
               ‚* Subsys Name                                                                                 
               ‚*                                                                                             
               d QUSSN00                72     81                                                             
               ‚*                                                                                             
               ‚* Subsys Lib                                                                                  
               ‚*                                                                                             
               d QUSSL06                82     91                                                             
               ‚*                                                                                             
               ‚* Curr Usrprf Name                                                                            
               ‚*                                                                                             
               d QUSCUN                 92    101                                                             
               ‚*                                                                                             
               ‚* Dbcs Enabled                                                                                
               ‚*                                                                                             
               d QUSDE                 102    102                                                             
               ‚*                                                                                             
               ‚* Exit Key                                                                                    
               ‚*                                                                                             
               d QUSEK                 103    103                                                             
               ‚*                                                                                             
               ‚* Cancel Key                                                                                  
               ‚*                                                                                             
               d QUSCK00               104    104                                                             
               ‚*                                                                                             
               ‚* Product Return Code                                                                         
               ‚*                                                                                             
               d QUSPRC                105    108B 0                                                          
               ‚*                                                                                             
               ‚* User Return Code                                                                            
               ‚*                                                                                             
               d QUSURC                109    112B 0                                                          
               ‚*                                                                                             
               ‚* Program Return Code                                                                         
               ‚*                                                                                             
               d QUSPGMRC              113    116B 0                                                          
               ‚*                                                                                             
               ‚* Special Environment                                                                         
               ‚*                                                                                             
               d QUSSE02               117    126                                                             
               ‚*                                                                                             
               ‚* Device Name                                                                                 
               ‚*                                                                                             
               d QUSDN                 127    136                                                             
               ‚*                                                                                             
               ‚* Group Profile Name                                                                          
               ‚*                                                                                             
               d QUSGPN                137    146                                                             
               d QUSGRP                        10    DIM(00015)                                               
               d  QUSGN00                      10    OVERLAY(QUSGRP:00001)                                    
               ‚*                                                                                             
               ‚* Job User ID                                                                                 
               ‚*                                                                                             
               d QUSJUID               297    306                                                             
               ‚*                                                                                             
               ‚* Job User ID Setting                                                                         
               ‚*                                                                                             
               d QUSJUIDS              307    307                                                             
               ‚*                                                                                             
               ‚* Make sure that the tape drive exists.  jamie                                                
               ‚*                                                                                             
               c                   Eval      ObjNam     =  %Trim(@USER)                                       
               c                   Eval      ObjLib     =  '*LIBL'                                            
               c                   Eval      ObjTyp     =  '*USRPRF'                                          
               ‚*                                                                                             
               c                   CallP     rtvObjD( RoData                                                  
               c                                    : %Size( RoData )                                         
               c                                    : 'OBJD0200'                                              
               c                                    : ObjNam + ObjLib                                         
               c                                    : ObjTyp                                                  
               c                                    : ApiError                                                
               c                                    )                                                         
               ‚*                                                                                             
               c                   eval      *INLR = *On                                                      
               ‚*-----------------------------------------------                                              
               ‚* *INZSR - Initial one time run subroutine                                                    
               ‚*-----------------------------------------------                                              
               c     *INZSR        begsr                                                                      
               c                   endsr                                                                      
               ‚*-----------------------------------------------
          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

          Working...
          X