Open/Close/DCB



High Level Assembler(HLASM) for MVS & VM & VSE

Open/Close/DCB

Postby RISCCISCInstSet » Fri Oct 28, 2011 9:14 am

In this assembly code, I'm trying to understand what I'm doing wrong with the open/close options and the DCB's. Can you tell me what I'm doing wrong and how to fix it?

:arrow: (The code is mainframe assembler but is based on the z390 emulator.)

         TITLE 'PROGRAM 4 80/80 LISTING'
         PRINT NOGEN
COPY     SUBENTRY
         WTO   'PROG4 COPY INFILE (ASCII) TO OUTFILE (ASCII)'
         OPEN  (DATAIN,INPUT,INFILE,OUTFILE)
         OPEN  (SUMMARY,OUTPUT)
         WTO   'Files opened successfully'
*
LOOP     EQU   *
         GET   INFILE,IRECORD
         MVC   ORECORD,=CL133' '
         MVC   ORECORD(80),IRECORD
         PUT   OUTFILE,ORECORD
         B     LOOP
*
EOF      EQU   *
         CLOSE (INFILE,,OUTFILE)
         WTO   'PROG4 ENDED OK'
         SUBEXIT
ENDDATA  DS    0H 
         CLOSE  (DATAIN,,SUMMARY) 
         SUBEXIT 
INFILE   DCB   DDNAME=INFILE,                                          X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               LRECL=80,                                               X
               EODAD=EOF,                                              X
               MACRF=GM
*
OUTFILE  DCB   DDNAME=OUTFILE,                                         X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               LRECL=133,                                              X
               MACRF=PM
*
DATAIN   DCB   DDNAME=INPUT,                                           X
               DSORG=PS,                                               X
               EODAD=ENDDATA,                                      Â    X
               LRECL=80,                                               X
               RECFM=FT,                                               X
               MACRF=GM 
SUMMARY  DCB   DDNAME=OUTPUT,                                          X
               BLKSIZE=130,                              Â              X
               LRECL=13,                                               X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               MACRF=PM 
IRECORD  DC    CL80' '
ORECORD  DC    CL133' '
         END COPY
RISCCISCInstSet
User avatar
RISCCISCInstSet
 
Posts: 121
Joined: Mon Oct 17, 2011 1:46 pm
Has thanked: 146 times
Been thanked: 0 time

Re: Open/Close/DCB

 

Re: Open/Close/DCB

Postby enrico-sorichetti » Fri Oct 28, 2011 9:29 am

it would be wiser to review the relevant manuals for the proper format of the OPEN macro instruction
here for example
http://publibz.boulder.ibm.com/cgi-bin/ ... 0122165044
not the latest one but more than enough for Your immediate needs
hint ...
         OPEN  (<dcbname>,(INPUT))   
         OPEN  (<dcbname>,(OUTPUT))   

and ....
         WTO   'Files opened successfully'
where did You find the certainty that the files were opened successfully ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

These users thanked the author enrico-sorichetti for the post:
RISCCISCInstSet (Mon Nov 12, 2012 4:58 am)
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Open/Close/DCB

Postby dick scherrer » Fri Oct 28, 2011 9:57 am

Hello,

What does the assembly show for the expansion of the OPEN macros?
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
RISCCISCInstSet (Mon Nov 12, 2012 4:58 am)
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Open/Close/DCB

Postby steve-myers » Sat Oct 29, 2011 12:22 am

The operands for OPEN (and CLOSE, for that matter) are in pairs: (<dcbname>,options for that DCB.<dcbname>,options for that DCB,...) If you specify an odd number of operands, the OPEN and CLOSE macros use a default option: INPUT for OPEN, and, eFFectively, nothing for CLOSE, for the last DCB. So, in

OPEN (DATAIN,INPUT,INFILE,OUTFILE)

your first DCB is OK,, but you did not specify a valid option for INFILE. OUTFILE was considered an option, not a DCB name, because it was paired with the INFILE DCB name.

Going to your DCBs. RECFM=FT is valid, but the T option refers to a hardware feature, track overflow, that no longer exists. You are better off not trying to use it. The odds are the input will fail because you did not specify RECFM=FB; most datasets are "blocked," each physical record contains more than one logical record.

Finally, your comments appear to indicate you are translating data from ASCII to EBCDIC, but there is no translation logic in your code.

These users thanked the author steve-myers for the post:
RISCCISCInstSet (Mon Nov 12, 2012 4:59 am)
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Open/Close/DCB

Postby dick scherrer » Sat Oct 29, 2011 1:07 am

Hi Steve,

(The code is mainframe assembler but is based on the z390 emulator.)
The entire exercise may be in ASCII :|

Have a great weekend!

d

These users thanked the author dick scherrer for the post:
RISCCISCInstSet (Mon Nov 12, 2012 4:59 am)
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Open/Close/DCB

Postby RISCCISCInstSet » Sat Oct 29, 2011 3:51 am

Update:

         TITLE 'PROGRAM 4 80/80 LISTING'
         PRINT NOGEN
COPY     SUBENTRY
         WTO   'PROG4 COPY INFILE (ASCII) TO OUTFILE (ASCII)'
         OPEN  (INFILE,INPUT)
         OPEN  (OUTFILE,OUTPUT)
         OPEN  (DATAIN,INPUT)
         OPEN  (SUMMARY,OUTPUT)
         WTO   'Files opened successfully'
*
LOOP     EQU   *
         GET   INFILE,IRECORD
         MVC   ORECORD,=CL133' '
         MVC   ORECORD(80),IRECORD
         PUT   OUTFILE,ORECORD
         B     LOOP
*
EOF      EQU   *
               CLOSE (INFILE,,OUTFILE)
               WTO   'PROG4 ENDED OK'
               SUBEXIT
ENDDATA  DS    0H 
              Â CLOSE  (DATAIN,,SUMMARY) 
              Â SUBEXIT 
INFILE   DCB   DDNAME=INFILE,                                          X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               LRECL=80,                                               X
               EODAD=EOF,                                              X
               MACRF=GM
*
OUTFILE  DCB   DDNAME=OUTFILE,                                         X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               LRECL=133,                                              X
               MACRF=PM
*
DATAIN   DCB   DDNAME=INPUT,                                           X
               DSORG=PS,                                               X
               EODAD=ENDDATA,                                      Â    X
               LRECL=80,                                               X
               RECFM=FT,                                               X
               MACRF=GM 
SUMMARY  DCB   DDNAME=OUTPUT,                                          X
               BLKSIZE=130,                              Â              X
               LRECL=13,                                               X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               MACRF=PM 
IRECORD  DC    CL80' '
ORECORD  DC    CL133' '
         END COPY


17:20:16 COPY      MZ390 START USING z390 V1.5.05 ON J2SE 1.6.0_29 10/28/11
17:20:16 COPY      MZ390 MZ390E error  11       (1/39)39 continuation line < 16 characters -                DSORG=PS,                                               X
17:20:16 COPY      MZ390 MZ390E error  11       (1/41)41 continuation line < 16 characters -                LRECL=80,                                               X
17:20:16 COPY      MZ390 MZ390E error  11       (1/43)43 continuation line < 16 characters -                MACRF=GM 
17:20:16 COPY      MZ390 MZ390E error  11       (1/45)45 continuation line < 16 characters -                BLKSIZE=130,                              Â              X
17:20:16 COPY      MZ390 MZ390E error  11       (1/47)47 continuation line < 16 characters -                DSORG=PS,                                               X
17:20:16 COPY      MZ390 MZ390E error  11       (1/49)49 continuation line < 16 characters -                MACRF=PM 
17:20:17 COPY      AZ390 AZ390E error  29       (1/7)113            OPEN  (DATAIN,INPUT)
17:20:17 COPY      AZ390 AZ390I ERRSUM missing macro = OPEN 
17:20:17 COPY      AZ390 AZ390E error 198     (5/108)117                          LA     1,SUMMARY
17:20:17 COPY      AZ390 AZ390I symbol not defined SUMMARY
17:20:17 COPY      AZ390 AZ390E error 196      (1/22)172   ENDDATA  DS    0H 
17:20:17 COPY      AZ390 AZ390I invalid character in opcode -  
17:20:17 COPY      AZ390 AZ390E error 196      (1/23)173   Â              Â CLOSE  (DATAIN,,SUMMARY) 
17:20:17 COPY      AZ390 AZ390I invalid character in opcode -  
17:20:17 COPY      AZ390 AZ390E error 196      (1/24)174   Â              Â SUBEXIT 
17:20:17 COPY      AZ390 AZ390I invalid character in opcode -  
17:20:17 COPY      AZ390 AZ390E error  29      (1/39)249   DATAIN   DCB   DDNAME=INPUT,                                                          DSORG=PS,                                               X
17:20:17 COPY      AZ390 AZ390I ERRSUM missing macro =  DCB 
17:20:17 COPY      AZ390 AZ390E error 196      (1/41)252   Â               EODAD=ENDDATA,                                      Â                   LRECL=80,                                               X
17:20:17 COPY      AZ390 AZ390I invalid character in opcode -  
17:20:17 COPY      AZ390 AZ390E error 196      (1/43)255   Â               RECFM=FT,                                                              MACRF=GM 
17:20:17 COPY      AZ390 AZ390I invalid character in opcode -  
17:20:17 COPY      AZ390 AZ390E error  29      (1/45)257   SUMMARY  DCB   DDNAME=OUTPUT,                                                         BLKSIZE=130,                              Â              X
17:20:17 COPY      AZ390 AZ390I ERRSUM missing macro = DCB 
17:20:17 COPY      AZ390 AZ390E error 196      (1/47)260   Â               LRECL=13,                                                              DSORG=PS,                                               X
17:20:17 COPY      AZ390 AZ390I invalid character in opcode -  
17:20:17 COPY      AZ390 AZ390E error 196      (1/49)263   Â               RECFM=FT,                                                              MACRF=PM 
17:20:17 COPY      AZ390 AZ390I invalid character in opcode -  
17:20:17 COPY      AZ390 AZ390E ERRSUM Critical Error Summary Option
17:20:17 COPY      AZ390 AZ390E ERRSUM Fix and repeat until all nested errors resolved
17:20:17 COPY      AZ390 AZ390E ERRSUM missing macro =OPEN 
17:20:17 COPY      AZ390 AZ390E ERRSUM missing macro = DCB 
17:20:17 COPY      AZ390 AZ390E ERRSUM missing macro =DCB 
17:20:17 COPY      AZ390 AZ390E ERRSUM total missing   copy   files =0
17:20:17 COPY      AZ390 AZ390E ERRSUM total missing   macro  files =3
17:20:17 COPY      AZ390 AZ390E ERRSUM total undefined symbols      =1
17:20:17 COPY      AZ390 AZ390E ERRSUM total mz390 errors    = 6
17:20:17 COPY      AZ390 AZ390E ERRSUM total az390 errors    = 11
17:20:17 COPY      AZ390 AZ390I FID=  1 ERR=  16 c:\Program Files\Automated Software Tools\z390\CS4321\COPY.MLC
17:20:17 COPY      AZ390 AZ390I FID=  5 ERR=   1 c:\PROGRA~1\AUTOMA~1\z390\mac\ZOPEN.MAC
17:20:17 COPY      MZ390 ENDED   RC=12 SEC= 0 MEM(MB)= 47 IO=2443
RISCCISCInstSet
User avatar
RISCCISCInstSet
 
Posts: 121
Joined: Mon Oct 17, 2011 1:46 pm
Has thanked: 146 times
Been thanked: 0 time

Re: Open/Close/DCB

Postby BillyBoyo » Sat Oct 29, 2011 3:54 am

I suggest you post all those Xs back where they came from.

These users thanked the author BillyBoyo for the post:
RISCCISCInstSet (Mon Nov 12, 2012 4:59 am)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Open/Close/DCB

Postby RISCCISCInstSet » Sat Oct 29, 2011 4:04 am

@BillyBoyo Are you referring to the continuation line errors? The X's were in column 72 before I pasted them. How do I resolve this type of error?
RISCCISCInstSet
User avatar
RISCCISCInstSet
 
Posts: 121
Joined: Mon Oct 17, 2011 1:46 pm
Has thanked: 146 times
Been thanked: 0 time

Re: Open/Close/DCB

Postby RISCCISCInstSet » Sat Oct 29, 2011 7:47 am

I'm still not sure how to handle the open statement. Can you point out what it is I'm not understanding, or give me a good URL, or location found from the URL, such that I understand how I'm screwing up? :geek:

Thanks
RISCCISCInstSet
User avatar
RISCCISCInstSet
 
Posts: 121
Joined: Mon Oct 17, 2011 1:46 pm
Has thanked: 146 times
Been thanked: 0 time

Re: Open/Close/DCB

Postby dick scherrer » Sat Oct 29, 2011 10:58 am

Hello,

You need to find the documentation for the assembler you are using. Possibly by looking on the z390 site.

I've never used z390, but they may have their own forum for z390 questions.
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
RISCCISCInstSet (Mon Nov 12, 2012 4:59 am)
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Next

Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post