|
Ann, I'm sure there's a better way to do this. This one's an oldie but a goodie. It downloads source members as individual files to a shared folder. The parameters used in calling this program are: &LIB - The library of the source file you are copying from &FILE - The source file you are copying from &FOLDER - The shared folder root directory you are copying to The result is that you'll have a root folder / library / source file hierarchy of source members, i.e., UserID/LIBRARY/SRCFILE/membern.ame To copy this from the shared folder to your PC drive, just use Windows Explorer, map a drive to the AS/400, i.e., \\AS400SYSNAME\QDLS\UserID , and drag/drop onto your hard drive. Notes: 1) Since the AS/400's DLS still uses the old DOS 8.3 file naming convention, any library, file, and member names that exceed 8 characters will have a '.' inserted after the 8th character. You will have problems if any of your names (library, file, member) on the 400 have a '.' in it. 2) The program also downloads a copy of file QAFDMBRL, which is the outfile from DSPFD TYPE(*MBRLIST); this is used when copying back to the AS/400 to give each member their source type and text description. 3) You didn't ask, but I also have the program to copy back to the AS/400. I'd be happy to post that as well if anybody's interested. PGM PARM(&LIB &FILE &FOLDER) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&FILE) TYPE(*CHAR) LEN(10) DCL VAR(&FOLDER) TYPE(*CHAR) LEN(80) DCLF FILE(QAFDMBRL) DCL VAR(&TO83NAME) TYPE(*CHAR) LEN(12) DSPFD FILE(&LIB/&FILE) TYPE(*MBRLIST) + OUTPUT(*OUTFILE) OUTFILE(QTEMP/QAFDMBRL) OVRDBF FILE(QAFDMBRL) TOFILE(QTEMP/QAFDMBRL) IF ( %SST( &LIB 9 2 ) *EQ ' ' ) THEN( DO ) CHGVAR &TO83NAME VALUE( &LIB ) ENDDO ELSE DO CHGVAR &TO83NAME VALUE( %SST( &LIB 1 8 ) + *CAT '.' *CAT %SST( &LIB 9 2 ) ) ENDDO CRTFLR FLR(&TO83NAME) INFLR(&FOLDER) TEXT('AS/400 source + library' *BCAT &LIB) MONMSG MSGID(CPF8A18) /* not created; ignore */ CHGVAR VAR(&FOLDER) VALUE(&FOLDER *TCAT '/' *CAT &TO83NAME) IF ( %SST( &FILE 9 2 ) *EQ ' ' ) THEN( DO ) CHGVAR &TO83NAME VALUE( &FILE ) ENDDO ELSE DO CHGVAR &TO83NAME VALUE( %SST( &FILE 1 8 ) + *CAT '.' *CAT %SST( &FILE 9 2 ) ) ENDDO CRTFLR FLR(&TO83NAME) INFLR(&FOLDER) TEXT('AS/400 + source file' *BCAT &LIB *TCAT '/' *CAT *FILE) MONMSG MSGID(CPF8A18) /* not created; ignore */ CHGVAR VAR(&FOLDER) VALUE(&FOLDER *TCAT '/' *CAT &TO83NAME) LOOP: RCVF MONMSG CPF0864 EXEC( GOTO EOF ) IF ( %SST( &MLNAME 9 2 ) *EQ ' ' ) THEN( DO ) CHGVAR &TO83NAME VALUE( &MLNAME ) ENDDO ELSE DO CHGVAR &TO83NAME VALUE( %SST( &MLNAME 1 8 ) + *CAT '.' *CAT %SST( &MLNAME 9 2 ) ) ENDDO CPYTOPCD FROMFILE(&LIB/&FILE) TOFLR(&FOLDER) + FROMMBR(&MLNAME) TODOC(&TO83NAME) + REPLACE(*YES) GOTO LOOP EOF: CPYTOPCD FROMFILE(QTEMP/QAFDMBRL) TOFLR(&FOLDER) + TODOC(QAFDMBRL) REPLACE(*YES) TRNTBL(*NONE) ENDPGM -----Original Message----- From: Ann Lewkowicz [mailto:alewkowi@one.net] Sent: Tuesday, February 08, 2000 10:55 AM To: MIDRANGE-L@midrange.com Subject: Downloading multiple source members Folks, I need to download multiple source members to a PC. Basically, I'm downloading entire files. I would like each member to have its own file on the PC. Has anyone got a good way to do this in batch? Thanks, Ann L. +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.