Looking at the program I think your displacement on the MVC is wrong. 
FCBI+16(8) might ought to be FCBI+9(8). But since you already have the FSCBD in 
place you would do better to use it

        LA FSCBD,R8
        LA R8,FSCBI
        MVC FSCBFN,=CL8'1608    '


Getting date and time:

        LA  R2,BUFFER
        LA  R3,24
        DIAG R2,R3,X'0C'
        MVC DATE,BUFFER
        MVC TIME,BUFFER+8


BUFFER DS 2D
DATE    DS CL8
TIME     DS CL8


FSWRITE example:

    put data in OUTBUFF then
    FSWRITE FSCB=OUTFILE,BUFFER=OUTBUFF

OUTFILE FSCB 'REPORT LISTING A',BUFFER=OUTBUFF,BSIZE=133
OUTBUFF DS  CL133




Bob Bates

Operating Systems Engineer, z/VM and Linux on System z
Enterprise Hosting Services, Mainframe/Midrange Services

Wells Fargo Bank | 4056 Old Denton Rd | Carrollton, TX 75007
MAC T5369-011
Tel 469-892-6660 | Cell 214-907-5071

robert.ba...@wellsfargo.com

This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.



________________________________
From: The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] On Behalf 
Of Sergio Lima
Sent: Monday, August 16, 2010 2:52 PM
To: IBMVM@LISTSERV.UARK.EDU
Subject: Assembler Samples

Hello List,

Years ago, We wrote a lot of Assembler programs and unfortunattely lost all of 
them.

Now, We try write a sample program, and need know, if someone, have a FSWRITE 
sample program, ans how get the date of the system.

My program is something like this :

CPUVM1   CSECT
         USING     CPUVM1,3
         LR        3,15
         ST        14,SAVE14
         MVC       FSCBI+16(8),=CL8'1608    '
         MVC       FSCBO+16(8),=CL8'1608    '
         FSOPEN    FSCB=FSCBI
*
LEITURA  FSREAD    FSCB=FSCBI,ERROR=FINAL
         WRTERM    INAREA,80
         CLC       INAREA+19(8),=CL8'AVGPROC-'
         BNE       LEITURA
         BAL       10,GRAVA
         MVC       INAREA,BRANCOS
         B         LEITURA
*
FINAL    C         15,=F'12'
         BE        SAI
         WRTERM    'ERRO NA LEITURA DO ARQUIVO'
*
SAI      L         14,SAVE14
         SR        15,15
         BR        14
*
GRAVA    MVC       OUTAREA,INAREA
         LA        7,OUTAREA
         FSWRITE   FSCB=FSCBO,RECNO=(7),ERROR=ERROGRAV
         MVC       OUTAREA,BRANCOS
         BR        10
*
ERROGRAV WRTERM    'ERRO NA GRAVACAO DO ARQUIVO'
         B         SAI
*
SAVE14   DS        F
INAREA   DS        CL85
OUTAREA  DS        CL85
BRANCOS  DC        CL85' '
FSCBI    FSCB      'CPUVM  ........ Z',BUFFER=INAREA,RECFM=V
FSCBO    FSCB      'CPUVM  ........ A',BUFFER=OUTAREA,RECFM=V
         FSCBD
         END       CPUVM1

The sample program above, had a error when try use the FSWRITE (not error, but 
rc <> 0).

Any help please ?

Thanks

Sergio Lima Costa
Sao Paulo - Brazil

Reply via email to