× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Jim

Here is part of the code I used to do a similar thing - saving libraries.

HTH

Jim


--- Main program --- partial

/* LIBRARY VARIABLES */
DCL VAR(&LIBSTRING) TYPE(*CHAR) LEN(1024)
/* COMMAND VARIABLES */
DCL VAR(&CMD) TYPE(*CHAR) LEN(6000)
DCL VAR(&LEN) TYPE(*DEC) LEN(15 5) VALUE(6000)

/* Call program to string libs to be saved into &LIBSTRING */
AWX_SAVE:
CALL PGM(SubPgm) PARM(&LIBSTRING)

/* String together the SAVLIB command to save the strung libs */
CHGVAR VAR(&CMD) +
VALUE('SAVLIB LIB(' *TCAT &LIBSTRING *TCAT ') +
DEV(TAP02) ENDOPT(*LEAVE) CLEAR(*AFTER) +
PRECHK(*YES) ACCPTH(*YES) SPLFDTA(*ALL) +
QDTA(*DTAQ) DTACPR(*DEV) OUTPUT(*OUTFILE) +
OUTFILE(UTLIB/SAV002PF01) OUTMBR(*FIRST *ADD)')

/* EXECUTE THE SAVE COMMAND */
CALL PGM(QCMDEXC) PARM(&CMD &LEN)


-- End Main pgm ---
--- Sub program ---

START: PGM PARM(&LIBSTRING) /* Daily library save +
creation */

VARIABLES: DCL VAR(&LIBSTRING) TYPE(*CHAR) LEN(1024)
DCL VAR(&CLRSTRING) TYPE(*CHAR) LEN(1024)

FILE: DCLF FILE(SAV001PF06)

CHGVAR VAR(&LIBSTRING) VALUE(&CLRSTRING)

LOOP: RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))

/* IF - FIRST LIBRARY IN LIST, PUT AT THE FRONT */
IF COND(%SST(&LIBSTRING 1 1) *EQ ' ') THEN(DO)
CHGVAR VAR(&LIBSTRING) VALUE(&DSLIBNAME)
ENDDO

/* ELSE - PLACE NAME IN LIST AFTER A BLANK */
ELSE CMD(DO)
CHGVAR VAR(&LIBSTRING) VALUE(&LIBSTRING *BCAT +
&DSLIBNAME)
ENDDO
ENDDO

/* GO BACK AND GET NEXT FILE RECORD */
GOTO CMDLBL(LOOP)

END:
ENDPGM


-- End subpgm ---

On Thu, Aug 21, 2008 at 5:05 PM, Rubino, Jim <Jim.Rubino@xxxxxxxx> wrote:

Hello everyone,

I am trying to great a CL program that will do a RCVF of a phy file that
has the name of objects that I want to save to a savf. As I read this
file I an trying to build a string of 60 objects in a variable. Then
using this variable on the SAVOBJ command. The problem I am having is
that the objects in the variable are not going into the individual OBJ
fields on the SAVF command.

Here is the code I have so far:

READ: RCVF
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(END))
CHGVAR VAR(%SST(&OBJNAM &SCNT 10)) VALUE(&ODOBNM)
CHGVAR VAR(&SCNT) VALUE(&SCNT + 10)
CHGVAR VAR(&CNT) VALUE(&CNT + 1)
IF COND(&CNT *GE 60) THEN(GOTO CMDLBL(SAVEF))
GOTO CMDLBL(READ)

SAVEF:
CHGVAR VAR(&SFCNT) VALUE(&SFCNT + 1)
CHGVAR VAR(&SFCNTA) VALUE(&SFCNT)
CHGVAR VAR(&SAVFNAM) VALUE('JPOSTSAR' || &SFCNTA)
CRTSAVF FILE(QGPL/&SAVFNAM)
MONMSG MSGID(CPF0000)

SAVOBJ OBJ(&OBJNAM) LIB(JDFOBJ) DEV(*SAVF) +
SAVF(&SAVFNAM)
MONMSG MSGID(CPF0000) EXEC(DO)
ENDDO

CHGVAR VAR(&OBJNAM) VALUE(&BLANKS)
CHGVAR VAR(&SCNT) VALUE(1)
CHGVAR VAR(&CNT) VALUE(0)
GOTO CMDLBL(READ)

TIA

Jim Rubino
Fike Corporation


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.