Sorry, you do not have permission to ask a question, You must login to ask a question.

Sorry, you do not have permission to ask a question.

brainchime.com

brainchime.com

brainchime.com Navigation

    • Home
    • About Us
    • Contact Us

Mobile menu

Close
  • Home
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags

brainchime.com Latest Questions

Admin
Admin
Asked: October 13, 20242024-10-13T06:19:24+05:30 2024-10-13T06:19:24+05:30In: IBM i

What is PSDS in AS400?

Why do we use the program status data structure (PSDS) in the RPG program? How do we declare it in RPG? Please provide examples for it. How do we do error handling using PSDS in an RPG program and what are the important sub-fields of PSDS that are looked at while doing error-handling in an RPG program?

as400rpg
  • 0
  • 0
  • 11
  • 8
  • Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp

Related Questions

  • what is level check error and how to resolve level check error?
  • What are AS400 systems. Please provide a introduction of AS400 systems?
  • Is there any online server available for practicing on AS400 system?
  • What are the menus available in AS400?
  • What is subsystem in AS400?
  • How to copy a save file from IFS to a library?
  • How to transfer savf from as400 to pc?
  • How to copy ifs file to another directory?
  • How to copy savf from ifs to pc?
  • How to copy ifs file to physical file?
  • How to copy save file to ifs?
  • How to copy spool file to ifs?
  • How to copy physical file to ifs?
  • How to copy file from pc to IFS?
  • How to download spool file from AS400?
  • How do I delete a library in AS400?
  • How do I copy data from AS400 to excel?
  • What is library in AS400?
  • How to find all the source physical file available in AS400?
  • How to find all libraries in AS400?
  • How to change the library list in AS400?
  • What is access path in AS400?
  • What is the difference between source physical file and physical file in as400?
  • how to find the source file of an object in as400?
  • how to change record length of source physical file in as400?
  • What is cpf4174 error in as400?
  • What is the use of varying keyword in rpgle?
  • What is DDS in AS400?
  • What is the difference between PF and LF in as400?
  • Why do we use CHGPF command in AS400?
  • how to create physical file in as400?
  • What are the data types supported by physical files in AS400?
  • how to add data in physical file in as400?
  • how to view journal entries in as400?
  • what is the use of ovrdbf in as400?
  • What is an array in AS400?
  • what is a data queue in as400 and why do we use data queue?
  • How to run stored procedure in AS400?
  • How to resolve session and device error in AS400?
  • how to check as400 system values?
  • How to check triggers on a file in as400?
  • How to find damaged objects in AS400?
  • what is module in as400?
  • How to create binding directory in as400?
  • how to create ifs folder in as400?
  • What is ASP in AS400?
  • What is JOBQ and how to create a JOBQ in AS400?
  • What is SEU in AS400 and why do we use it?
  • What is the multi-format logical file in AS400?
  • what is PR and PI in rpgle?
Leave an answer

Leave an answer
Cancel reply

Browse
Browse

Choose from here the video type.

Put Video ID here: https://www.youtube.com/watch?v=sdUUx5FdySs Ex: "sdUUx5FdySs".

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Admin
    Admin
    2024-10-13T06:20:45+05:30Added an answer on October 13, 2024 at 6:20 am
    This answer was edited.

    The PSDS keyword for a free-form definition or the S letter, which appears in the 23rd position in a fixed format RPG, is used to identify it. It offers information on program exceptions and errors that the program can access.

    To ensure that each module can only have a single PSDS, it must be defined in the main source section. Predefined subfields are present in a PSDS.

    Declaring PSDS in Fixed format RPG program:

          * Program status data structure                                                             
          * program exception available to rpg program (1 psds per module)                            
                                                                                                      
         D psds1          SDS                                                                         
         D proc_name         *proc                                                  * module/program  
          * 1 to 10 position, 10 chars                                                                
         D pgm_status        *status                                                * status code     
          * 11 to 15 position, (5,0) zoned decimal                                                    
         D pgm_prvstatus          16     20S 0                                      * Prev. status    
         D src_listing            21     28                                         * src. list line  
         D routine           *routine                                               * routine         
          * 29 to 36 position, 8 chars                                                                
          * *INIT  --> program initialization                                                         
          * *DETL  --> detail lines                                                                   
          * *GETIN --> get input record                                                               
          * *TOTC  --> Total calculations                                                             
          * *TOTL  --> Total lines                                                                    
          * *DETC  --> Detail calculations                                                            
          * *OFL   --> Overflow lines                                                                 
          * *TERM  --> Program ending                                                                    
          * *ROUTINE --> name of program or procedure called (first 8 chars)                             
         D parms             *parms                                                 * no. of parms pass  
          * 37 to 39 position, (3,0) zoned decimal                                                       
         D excptype               40     42                                         * exception type     
          * CPF --> operating system exception                                                           
          * MCH --> machine exception                                                                    
         D excpnum                43     46                                         * exception number   
          * CPF --> CPF message number                                                                   
          * MCH --> MCH message number                                                                   
         D reserved1              47     50                                         * reserved           
         D workarea               51     80                                         * internal use by    
                                                                                    * ILE RPG compiler   
         D pgmlib                 81     90                                         * prgram library     
         D excpdata               91    170                                         * exception data     
         D excpcause             171    174                                         * exception that     
                                                                                    * cause RNX9001      
         D filename              175    184                                         * file name on whic  
                                                                                    *h last file operati 
                                                                                    *on occur updated on 
                                                                                    *ly when error occur   
         D unused                185    190                                         * unused               
         D date                  191    198                                         * date(*date format)   
         D yy                    199    200S 0                                      * first two digits     
                                                                                    * of 4 digit year      
         D filenametrn           201    208                                         * file name truncate   
                                                                                    * (175-184 pos above   
         D statusinfo            209    243                                         * status info on las   
                                                                                    *t file used           
         D jobname               244    253                                         * job name             
         D username              254    263                                         * user name            
         D jobnumber             264    269                                         * job number           
         D date2                 270    275S 0                                      * date (udate format   
                                                                                    * pgm running          
                                                                                    * (191-198 pos above   
         D pgmrundate            276    281S 0                                      * date of pgm runnin   
         D time                  282    287S 0                                      * time (hhmmss)        
                                                                                    * pgm running          
         D date3                 288    293                                         * date (udate format   
                                                                                    * pgm compiled         
         D time2                 294    299                                         * time (hhmmss)      
                                                                                    * pgm compiled       
         D cmplevel              300    303                                         * compiler level     
         D srcfile               304    313                                         * src file name      
         D srclib                314    323                                         * src lib name       
         D srcmbr                324    333                                         * src file member    
         D pgmproc               334    343                                         * pgm containing     
                                                                                    * procedure          
         D modproc               344    353                                         * module containing  
                                                                                    * procedure          
         D srcid                 354    355B 0                                      * src id match the   
          * binary  2 (5i,0)                                                                             
                                                                                    * statement number   
                                                                                    * from pos 21-28     
         D srcid2                356    357B 0                                      * src id match the   
          * binary  2 (5i,0)                                                                             
                                                                                    * statement number   
                                                                                    * from pos 228-235   
         D curuserprf            358    367                                         * current user profi 
         D exterrorcd            368    371I 0                                      * external error cod 
          * Integer (10,0)                                                                                
         D elements              372    379I 0                                      * elements set by XM  
          * Integer (20,0)                                                                                
                                                                                    *L-INTO or DATA-INTO  
         D internaljobid         380    395                                         * internal job id     
         D systemname            396    403                                         * system name         
         D unused2               404    429       

    We can declare program status data structure in rpgle free format as follows:

    **FREE 
    // Program status data structure 
    // program exception which is available to rpg program // (1 psds per module is asllowd)) 
    dcl-ds psdsname psds; 
    proc_name *proc; //name of the module or program position 1 to 10 (10 chars)
    pgm_status *status; //status code position 11 to 15 (5,0) zoned decimal 
    pgm_previousstatus zoned(5);// Previous status 
    source_listing char(8); // source list line 
    routineName *routine; // routine name position 29 to 36, (8 chars)
    // *INIT --> program initialization & 
    // *DETL --> detail lines  &
    // *GETIN --> get the input record  
    // *TOTC --> Total calculations 
    // *TOTL --> Total lines 
    // *DETC --> Detail calculations 
    // *OFL --> Overflow lines 
    // *TERM --> Program ending 
    // *ROUTINE --> name of program or procedure called (first 8 chars) 
    params *parms; // no. of parms pass position 37 to 39, (3,0) zoned decimal 
    exceptionType char(3); // exception type 
    // CPF --> operating system exception 
    // MCH --> machine exception 
    exceptionNumber char(4);//exception number 
    // CPF --> CPF message number 
    // MCH --> MCH message number 
    reserved1 char(4);// reserved 
    workarea char(30); // internal use by ILE RPG compiler 
    programlibrary char(10); // prgram library 
    exceptiondata char(80); // exception data 
    exceptioncause char(4); //exception that cause RNX9001 
    filecname char(10); // file name on whicc last file 
    // operation occur updated only when error occur 
    unused char(6); //unused 
    date char(8); //date(*date format) 
    yy zoned(2); //first two digits of 4 digit year 
    filenametruncate char(8); // file name truncate 175-184 pos above 
    statusinfo char(35); // status info on last file used 
    jobname char(10); // job name 
    username char(10); // user name 
    jobnumber zoned(6); //job number 
    date2 zoned(6); // date (udate format pgm running (191-198 pos above 
    programrundate zoned(6); // date of pgm running 
    time zoned(6); // time (hhmmss) pgm running 
    date3 char(6); // date (udate format pgm compiled 
    time2 char(6); // time (hhmmss) pgm compiled 
    compilerlevel char(4); // compiler level 
    sourcefile char(10); // src file name 
    sourcelibrary char(10); // src lib name 
    sourcemember char(10); //src file member 
    programprocedure char(10); // pgm containing procedure 
    moduleprocedure char(10); // module that contains procedure 
    sourceid bindec(2); // source id that match the statement number from pos 21-28 
    sourceid2 bindec(2); // src id that match the statement number from pos 228-235 binary 2 (5i,0) 
    currentuserprofile char(10); // this is current user profile 
    externalerrorcode int(10); // this is external error code Integer (10,0) 
    elements int(20); //his is elements set by XML-INTO or DATA-INTO Integer (20,0) 
    internaljobid char(16); //this is internal job id 
    systemName char(8); // this is system name 
    unused2 char(6); // this is unused field
    end-ds; 
      • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp

Sidebar

Statistics

  • Questions 143
  • Answers 177
  • Comments 0
  • Popular
  • Answers
  • Admin

    Why do we use OVERLAY keyword in data structure subfields ...

    • 12 Answers
  • Admin

    How to call sql stored procedure with output parameter from ...

    • 6 Answers
  • Admin

    How to use declare global temporary table statement in RPGLE?

    • 5 Answers
  • Admin
    Admin added an answer CPF4131 is a record format level check error. This indicates… October 18, 2024 at 1:58 am
  • Admin
    Admin added an answer To open the command prompt with administrator rights you can… October 17, 2024 at 12:27 am
  • Admin
    Admin added an answer In AS400, "AS" stands for Application system. This article discusses… October 13, 2024 at 12:49 pm

Related Questions

  • Admin

    what is level check error and how to resolve level ...

    • 1 Answer
  • Admin

    What are AS400 systems. Please provide a introduction of AS400 ...

    • 1 Answer
  • Admin

    Is there any online server available for practicing on AS400 ...

    • 1 Answer
  • Admin

    What are the menus available in AS400?

    • 1 Answer
  • Admin

    What is subsystem in AS400?

    • 1 Answer

Trending Tags

.htaccess (1) as400 (123) bing-webmaster (2) control-language (12) db2 (33) ftp (8) google-adsense (1) google-search-console (3) https-redirect (1) iasp (4) ifs (22) jar (4) operations (3) php-my-admin (1) qshell (3) robots.txt (4) rpg (26) stored-procedure (3) stroed procedure (1) triggers (1) yoast (4)

Explore

  • Home
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags

Footer

BrainChime

BrainChime is a blog that posts question-and-answer-based format articles on diverse topics and engages in discussions by allowing people to provide answers/comments without the need to register and log in.

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • FAQs
  • Categories
  • Tags

© 2024 BrainChime. All Rights Reserved
by BrainChime.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.

      Notifications