Johnny Luo wrote:
Steve,
Here is my program:
***********************************************************************
* AUTHOR: JOHNNY *
* DATE : 05/11/07
* DESCRIPTION: UPDATE A PS,FB FILE USING QSAM
* I-O FILE: INVMAST(PS,FB,50)
***********************************************************************
TITLE 'DEMONSTRATE HOW TO UPDATE UISNG QSAM'
QSAMUPD CSECT
* HOUSEKEEPING
SAVE (14,12)
LR 3,15
USING QSAMUPD,3 BASE REGISTER
LA 15,SAVEAREA
ST 15,8(,13)
ST 13,SAVEAREA+4
LR 13,15
* MAINLINE
OPEN (INVMAST,UPDAT)
READ GET INVMAST
MVC 0(50,1),=CL50'UPDATED BY QSAM HAHA!'
PUTX INVMAST
B READ
EOF CLOSE (INVMAST)
* HOUSEKEEPING
L 13,SAVEAREA+4
MVC 16(4,13),RC
RETURN (14,12)
* WORKING AREA
LTORG
INVMAST DCB DDNAME=INVMAST, X
DSORG=PS, X
RECFM=FB, X
LRECL=50, X
EODAD=EOF, X
MACRF=(GL,PM)
*
SAVEAREA DS 18F
RC DC F'0'
END QSAMUPD
Ah! You see: you said you were going to use Put Move
(MACRF=(GL,PM)), but you actually used Put Locate (or,
more precisely, PUTX Locate) because your PUTX only
has one operand. To use PUTX Move mode you need to
specify two operands: the DCB and location where the
record should be put from; so you used PUTX locate
mode even though you promised to use PUTX move mode;
so you got away with a little lie. The proper way is
to code MACRF=(GL,PL). Try it that way. It will work
and will be correct.
On 8/21/07, Steve Comstock <[EMAIL PROTECTED]> wrote:
Hmmmm. I'd have to see the program.
--
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-393-8716
http://www.trainersfriend.com
z/OS Application development made easier
* Our classes include
+ How things work
+ Programming examples with realistic applications
+ Starter / skeleton code
+ Complete working programs
+ Useful utilities and subroutines
+ Tips and techniques
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html