List AS400 files

Solved
mica94 Posted messages 39 Registration date   Status Member Last intervention   -  
 tirsix -
Hello,

I just joined a company that operates on AS400, which I know very little about.
I have request queries to execute (I can do queries), but I don't know where to find the files to read.

I would like to know if there is a command to list the files in a library along with their descriptions.

Thank you
Configuration: Windows 2000 Firefox 2.0.0.1

12 answers

  1. Gwe56
     
    Good evening,

    It seems to me that the following file can help you: QSYS/QADBXREF
    If I remember correctly, it gathers all the files from your AS400

    Gwénaël
    3
  2. RC
     
    hello hi I am an independent expert on AS400
    you can contact me by email.
    I respond to all questions.
    Best regards RC.
    3
    1. denist
       
      Hello,
      Since you are an AS/400 expert, I would be interested in learning more about this system and I have some questions. For example, how to connect to an AS/400 database from SQL queries made from a web application developed in Java?
      0
    2. Fossé > denist
       
      Well, with the JDBC provided on the AS400, right?

      /QIBM/ProdData/HTTP/Public/jt400/lib

      But personally, I don't find it very nice to access the database via SQL. Practical for sure, but fragile, in case of changes to the database, which may also be used by a "400" application. Most of the time, in companies that have been using an AS400 for a certain period, there is a significant list of native programs, RPG or Cobol. It's better to call them rather than reinvent their functionalities.

      Seb
      0
    3. Yves29 Posted messages 13 Status Member 1
       
      Hello, I'm looking for a way in VB to check if a file exists in a library on my AS400.
      Do you have any ideas?
      1
    4. Fossé > Yves29 Posted messages 13 Status Member
       
      On AS400, the command to check the existence of an object is CHKOBJ OBJ(BIB/FILE) OBJTYPE(*FILE). This command needs to be encapsulated in a small CLP program with a Yes/No output parameter, and this program should be called from VB. It’s a bit cumbersome, but in case of a direct command call from VB, we would also need to intercept the message giving the response, which would also be cumbersome, to my knowledge.
      There you go.
      0
    5. Yves29 Posted messages 13 Status Member 1 > Fossé
       
      I found a VB program that lists all the files in a library, but it's very heavy. I will test your command tomorrow. Thank you.
      0
  3. tirsix
     
    Hello,
    You type this command and press F4 to change the name of the library (MABIB) and the output file (MONFIC)
    DSPOBJD OBJ(mabib/*ALL) OBJTYPE(*FILE) DETAIL(*FULL) OUTPUT(*OUTFILE) OUTFILE(QTEMP/monfic)
    Good luck
    2
  4. BugMaker Posted messages 34 Status Member 7
     
    Hi,
    it’s been almost 3 years since I last touched an AS400, so thanks for being understanding... let’s see if I haven’t lost my memory.
    You start with the DSPLIBL command which displays all the libraries in your environment.
    Then for each library (non-system of course) you do a WRKOBJ with *FILE as the object type.
    And there you go, you’ll eventually find the library that contains your files...
    If needed, I still have some old documentation... don’t hesitate to ask me questions.
    A++
    ------------------------------------------------------------------
    If there’s no solution, there’s no problem!
    1
  5. mica94 Posted messages 39 Registration date   Status Member Last intervention  
     
    Thank you very much, I have what I want.
    ;)
    0
  6. Founnzy
     
    Hello!!!

    I currently have to run SQL queries on an AS400, but it is not on our premises (remote site and no possibility to access the "terminal")
    My question is as follows: Can we run the command DSPLIBL via an SQL query????

    Thank you in advance.

    Founnz
    0
    1. BugMaker Posted messages 34 Status Member 7
       
      Hi,
      The DSPLIBL command is a "system" command of OS400 and not an SQL command.
      Rather tell us how you access the AS400, we might find a solution.
      See you++
      phil
      --
      If there is no solution, it means there is no problem!
      0
    2. founnzy
       
      Hi,

      I'm developing asp pages (vb script) and I'm connecting to the database using an Access ODBC driver.

      Thanks again
      0
      1. Jerome > founnzy
         
        Hi Founnzy, do you have a tool like client access installed on your machine?
        If not, you might have a bit of trouble finding what you're looking for...

        Jerome
        0
  7. arth Posted messages 84 Registration date   Status Contributor Last intervention   1 296
     
    Hello!

    Why don’t you work on a 5250 terminal?
    --
    The wolf, solitary and mysterious.
    0
  8. arth Posted messages 84 Registration date   Status Contributor Last intervention   1 296
     
    AS400 is not software; it is an IBM machine running OS 400. Not the same thing at all.

    Wolf.
    --

    The wolf, solitary and mysterious.
    0
  9. slt ca va
     
    Je voudrais savoir comment modifier un programme AS/400.
    0
  10. 0000
     
    ```c
    #include <stdio.h>
    #include <stdlib.h>
    #include <dirent.h>
    #include <string.h>

    int compare(const void *a, const void *b) {
    return strcmp(*(const char **)a, *(const char **)b);
    }

    int main() {
    DIR *dir;
    struct dirent *ent;
    char *files[100];
    int count = 0;

    if ((dir = opendir(".")) != NULL) {
    while ((ent = readdir(dir)) != NULL) {
    files[count] = malloc(strlen(ent->d_name) + 1);
    strcpy(files[count], ent->d_name);
    count++;
    }
    closedir(dir);

    qsort(files, count, sizeof(char *), compare);

    printf("Contents of the directory:\n");
    for (int i = 0; i < count; i++) {
    printf("%s\n", files[i]);
    free(files[i]);
    }
    } else {
    perror("Could not open directory");
    return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
    }
    ```</string.h></dirent.h></stdlib.h></stdio.h>
    0
  11. antho
     
    Hello, is it possible to automatically feed a database in Excel from AS400? Can I go through an email? Thank you for your help.
    0
  12. tanguo
     
    Hello
    I work on AS400 and I would like to have the command that can give me for a PF file
    ZONE, ATTRIBUTE, LENGTH, TYPE, DESCRIPTION.
    But the DSPFFD command does not meet my needs; I need this in a list.
    Thank you in advance.
    0
    1. elpoulet
       
      To list the zones of a file, you need to create a program that analyzes the output file generated by the command:
      DSPFFD FILE(&BIBL/&FICH) OUTPUT(*OUTFILE) OUTFILE(QTEMP/DSPFLD00) SYSTEM(*LCL)

      This command lists the zones of the file &FICH from the library &BIBL in the DSPFLD00 file in QTEMP.

      I hope this answers your question.
      0
    2. othanga
       
      You can use QSYS/QADBIFLD, which lists all the fields of all the files visible on your system.
      0