help please (DCB Macro) 
Author Message
 help please (DCB Macro)

Please excuse me, I'm a PC Programmer writing a mainframe assembler program.

If I sound like I don't know what I'm doing, it's because that is true...
I've been learning mainframe assembler on MVS for 3 days, and I have most of
my program working.  However, there are a few details I haven't figured out
yet.

1) Is it possible to determine at run-time the block size, record format,
and record length of an input file.  I think this is stored in the DCB data
area, but I haven't found any documentation on this in any of the online
books. (book manager)

2) if it is possible to determine these values, how?

3) if not, is there any way to get it from JES2?  (is there an api?)

Thanks for any help...
Please email the reply...

Feel free to pass on any PC questions you have to me... I am an expert C,
C++, Pascal, x86 Assembler, and VB programmer.

Kelly Leahy



Sat, 16 Jun 2001 03:00:00 GMT  
 help please (DCB Macro)
No problem.

Assume your DCB is defined as follows:

MYDCB    DCB   DDNAME=MYFILE,MACRF=GM,DSORG=PS

MYFILE points to a DD card coded somewhat like this:

//MYFILE DD DSN=THIS.ISMY.FILE,DISP=SHR

The DSN parameter is the calatogued name of your dataset. It may be a sequential
file or a PDS(partitioned data set).

Your program must include a mapping of the DCB as follows:

         DCBD  DSORG=PS,DEVD=DA

The assembler instructions follow:

         OPEN  (MYDCB,INPUT),MODE=31    Open the DCB for input (whence GM above)

         LA    R02,MYDCB                          Get address of DCB
         USING IHADCB,R02                      Template the DCB fields
         LH    R03,DCBBLKSI                      Get the BLKSIZE
         LH    R04,DCBLRECL                      Ditto the LRECL
         TM    DCBRECFM,DCBRECF              Is it fixed-length ?
         BZ    NOT_FIXED                           No
         TM    DCBRECFM,DCBRECBR            Is it blocked ?
         BZ    NOT_BLOCKED                      No
         ...     ....                                      We have fixed blocked
records at this point

          DROP  R02                                   De-template the DCB fields

The bookmanager manuals refering the the data management macros are in the
DFHSMS bookshelf. The books are 'USING DATA SETS' and 'MACRO INSTRUCTIONS FOR
DATA SETS'.

I hope this helps.



Sun, 17 Jun 2001 03:00:00 GMT  
 help please (DCB Macro)

Quote:
>Please excuse me, I'm a PC Programmer writing a mainframe assembler program.

>If I sound like I don't know what I'm doing, it's because that is true...
>I've been learning mainframe assembler on MVS for 3 days, and I have most of
>my program working.  However, there are a few details I haven't figured out
>yet.

We all had to start somewhere.  Don't worry about it.  For me, it's been
30 years, and I had the same trouble back then.

Quote:

>1) Is it possible to determine at run-time the block size, record format,
>and record length of an input file.  I think this is stored in the DCB data
>area, but I haven't found any documentation on this in any of the online
>books. (book manager)

Yes.  The contents of the DCB are described in a DSECT generated by the
DCBD macro.  The record format is in bits in a one byte data area called
DCBRECFM, the record length in DCBLRECL, and the block size in DCBBLKSI.
For input, these fields are not valid until after the DCB is open.
For output, they pretty well have to be filled in, either before OPEN,
either in the DCB or the data set label, or during OPEN by an exit routine
that is in your program.

The books don't really talk about the internal format of the DCB because
the DCBD macro is so handy.  A paper form is in "DFSMS/MVS V1R4 Macro Instructions for Data Sets," at URL

http://ppdbooks.pok.ibm.com:80/cgi-bin/bookmgr/bookmgr.cmd/BOOKS/DGT1...

Quote:

>2) if it is possible to determine these values, how?

In what sense do you mean?

For an existing direct access data set, you can read the data set label,
and retrieve the values.  The method to do this is beyond the scope of this
post.  For a tape data set, you pretty well have to wait until OPEN
processing has merged the values into the DCB.

Quote:

>3) if not, is there any way to get it from JES2?  (is there an api?)

For JES2 input, you can assume the DCB is RECFM=F, LRECL=80, BLKSIZE=80.
For JES2 output, JES2 will deal with anything you give it.  However, there
is no particular value in trying the block the data.  Internally, JES2
stores the data in a bastardized VB or VBS format, but you, as an
application programmer, do not see this.

JES2 only knows about its data sets.  There is no JES2 API to retrieve
information for non-JES2 data.  JES2 input, except for special cases that
only system programmers deal with very rarely, the data attributes are
fixed.  Output, like I said, JES2 deals with what you give it.

Quote:

>Thanks for any help...
>Please email the reply...

>Feel free to pass on any PC questions you have to me... I am an expert C,
>C++, Pascal, x86 Assembler, and VB programmer.

>Kelly Leahy


-- Steve Myers

The E-mail addresses in this message are private property.  Any use of them
to  send  unsolicited  E-mail  messages  of  a  commerical  nature  will be
considered trespassing,  and the originator of the message will be  sued in
small claims court in Camden County,  New Jersey,  for the  maximum penalty
allowed by law.



Sun, 17 Jun 2001 03:00:00 GMT  
 help please (DCB Macro)
Your code to test for block type will not work reliably.  It will not
branch for RECFM=U.

In addition, given that the MARCF is GM, I cannot see where there is
any value in testing whether the records in the data set are blocked,
since the application will see just one record at a time.


Quote:
>No problem.

>Assume your DCB is defined as follows:

>MYDCB    DCB   DDNAME=MYFILE,MACRF=GM,DSORG=PS

>MYFILE points to a DD card coded somewhat like this:

>//MYFILE DD DSN=THIS.ISMY.FILE,DISP=SHR

>The DSN parameter is the calatogued name of your dataset. It may be a sequential
>file or a PDS(partitioned data set).

>Your program must include a mapping of the DCB as follows:

>         DCBD  DSORG=PS,DEVD=DA

>The assembler instructions follow:

>         OPEN  (MYDCB,INPUT),MODE=31    Open the DCB for input (whence GM above)

>         LA    R02,MYDCB                          Get address of DCB
>         USING IHADCB,R02                      Template the DCB fields
>         LH    R03,DCBBLKSI                      Get the BLKSIZE
>         LH    R04,DCBLRECL                      Ditto the LRECL
>         TM    DCBRECFM,DCBRECF              Is it fixed-length ?
>         BZ    NOT_FIXED                           No
>         TM    DCBRECFM,DCBRECBR            Is it blocked ?
>         BZ    NOT_BLOCKED                      No
>         ...     ....                                      We have fixed blocked
>records at this point

>          DROP  R02                                   De-template the DCB fields

>The bookmanager manuals refering the the data management macros are in the
>DFHSMS bookshelf. The books are 'USING DATA SETS' and 'MACRO INSTRUCTIONS FOR
>DATA SETS'.

>I hope this helps.

-- Steve Myers

The E-mail addresses in this message are private property.  Any use of them
to  send  unsolicited  E-mail  messages  of  a  commerical  nature  will be
considered trespassing,  and the originator of the message will be  sued in
small claims court in Camden County,  New Jersey,  for the  maximum penalty
allowed by law.



Sun, 17 Jun 2001 03:00:00 GMT  
 help please (DCB Macro)
I know. I was just giving hi some coding. I also didn't code a DCBE,execute and list
format OPENs,etc,etc,etc.


Sun, 17 Jun 2001 03:00:00 GMT  
 help please (DCB Macro)
You can get this information from the JFCB (job file control block).  There are
other ways as well. You use a RDJFCB (read JFCB) macro to retrieve the
information.  The mapping macro for the data is in IEFJFCBN.  Some of the
information is not filled in until after the open macro is issued.

IBM has all of their manual online now.  Here's an example they give (I modified
it to make it less complicated):

      EX3       OPEN (INVEN)

     EX1       RDJFCB (INVEN)
                         .

               .
     INVEN     DCB      EXLST=LSTA,...

     LSTA      DS       0F
               DC       X'07'
               DC       AL3(JFCBAREA)
               .
               .
               .
     JFCBAREA  DS       0F,176C
               .
               .
               .
     LSTB      DS       0F
               .

   Figure 64. Example Code Using RDJFCB Macro

The information that you want will be returned in the area designated in the
example as JFCBAREA.  Use the mapping macro IEFJFCBN found in either SYS1.MACLIB
or SYS1.MODGEN, to find the field names you need.

The relevent IBM manual is: DFSMS/MVS V1R4 Using Data Sets, which can be found
at:

http://www.s390.ibm.com/os390/bkserv/v2r6books.html

I hope this helps.

John

Quote:

> Please excuse me, I'm a PC Programmer writing a mainframe assembler program.

> If I sound like I don't know what I'm doing, it's because that is true...
> I've been learning mainframe assembler on MVS for 3 days, and I have most of
> my program working.  However, there are a few details I haven't figured out
> yet.

> 1) Is it possible to determine at run-time the block size, record format,
> and record length of an input file.  I think this is stored in the DCB data
> area, but I haven't found any documentation on this in any of the online
> books. (book manager)

> 2) if it is possible to determine these values, how?

> 3) if not, is there any way to get it from JES2?  (is there an api?)

> Thanks for any help...
> Please email the reply...

> Feel free to pass on any PC questions you have to me... I am an expert C,
> C++, Pascal, x86 Assembler, and VB programmer.

> Kelly Leahy




Wed, 27 Jun 2001 03:00:00 GMT  
 help please (DCB Macro)

Kelly,

The information you seek is all available in the DCB after the input file is OPENed. Use the DCBD macro to map the DCB fields using the IHADCB dsect. The fields you are looking for are DCBLRECL, DCBBLKSI and DCBRECFM. The following code should give you an idea how it works:

         DCBD  DSORG=QS
         :
TESTDCB  CSECT
         :
         OPEN  THEFILE              Open the file
         USING THEFILE,IHADCB       Make DCB fields addressable
         MVC   RECSIZE,DCBLRECL     Save record length
         MVC   BLKSIZE,RECSIZE      Set block size for unblocked
         TM    DCBRECFM,DCBRECU     Is it 'Undefined' length records?
         BO    UNDEF                  Yes-Go do undefined
         TM    DCBRECFM,DCBRECBR    Are records blocked?
         BZ    UNBLOCK                No-Already have block size
         MVC   BLKSIZE,DCBBLKSI     Save block size
UNBLOCK  DS    0H
         MVC   BLKSIZE,DCBBLKSI     Save block size
         TM    DCBRECFM,DCBRECF     Is it 'Fixed' length records?
         BO    FIXED                  Yes-Go do fixed
         TM    DCBRECFM,DCBRECV     Is it 'Variable' length records?
         BO    VARIABLE               Yes-Go do variable
         B     UNKNOWN                No-Unknown record format
         :
UNDEF    DS    0H
         :
FIXED    DS    0H
         :
VARIABLE DS    0H
         :
THEFILE  DCB   MACRF=GL,DSORG=PS    Minimal Input DCB
         :

That's it. You must be careful with the order of testing for record format. This is because DCBRECU = DCBRECF+DCBRECV. Otherwise, have fun.

George Cleveland
Synergy Software Solutions, Inc.

Quote:

>You can get this information from the JFCB (job file control block).  There are
>other ways as well. You use a RDJFCB (read JFCB) macro to retrieve the
>information.  The mapping macro for the data is in IEFJFCBN.  Some of the
>information is not filled in until after the open macro is issued.

>IBM has all of their manual online now.  Here's an example they give (I modified
>it to make it less complicated):

>      EX3       OPEN (INVEN)

>     EX1       RDJFCB (INVEN)
>                         .

>               .
>     INVEN     DCB      EXLST=LSTA,...

>     LSTA      DS       0F
>               DC       X'07'
>               DC       AL3(JFCBAREA)
>               .
>               .
>               .
>     JFCBAREA  DS       0F,176C
>               .
>               .
>               .
>     LSTB      DS       0F
>               .

>   Figure 64. Example Code Using RDJFCB Macro

>The information that you want will be returned in the area designated in the
>example as JFCBAREA.  Use the mapping macro IEFJFCBN found in either SYS1.MACLIB
>or SYS1.MODGEN, to find the field names you need.

>The relevent IBM manual is: DFSMS/MVS V1R4 Using Data Sets, which can be found
>at:

>http://www.s390.ibm.com/os390/bkserv/v2r6books.html

>I hope this helps.

>John


>> Please excuse me, I'm a PC Programmer writing a mainframe assembler program.

>> If I sound like I don't know what I'm doing, it's because that is true...
>> I've been learning mainframe assembler on MVS for 3 days, and I have most of
>> my program working.  However, there are a few details I haven't figured out
>> yet.

>> 1) Is it possible to determine at run-time the block size, record format,
>> and record length of an input file.  I think this is stored in the DCB data
>> area, but I haven't found any documentation on this in any of the online
>> books. (book manager)

>> 2) if it is possible to determine these values, how?

>> 3) if not, is there any way to get it from JES2?  (is there an api?)

>> Thanks for any help...
>> Please email the reply...

>> Feel free to pass on any PC questions you have to me... I am an expert C,
>> C++, Pascal, x86 Assembler, and VB programmer.

>> Kelly Leahy




Thu, 28 Jun 2001 03:00:00 GMT  
 help please (DCB Macro)

Kelly,

Sorry, the first post had the USING fields backwards.

The information you seek is all available in the DCB after the input file is OPENed. Use the DCBD macro to map the DCB fields using the IHADCB dsect. The fields you are looking for are DCBLRECL, DCBBLKSI and DCBRECFM. The following code should give you an idea how it works:

         DCBD  DSORG=QS
         :
TESTDCB  CSECT
         :
         OPEN  THEFILE              Open the file
         USING IHADCB,THEFILE       Make DCB fields addressable
         MVC   RECSIZE,DCBLRECL     Save record length
         MVC   BLKSIZE,RECSIZE      Set block size for unblocked
         TM    DCBRECFM,DCBRECU     Is it 'Undefined' length records?
         BO    UNDEF                  Yes-Go do undefined
         TM    DCBRECFM,DCBRECBR    Are records blocked?
         BZ    UNBLOCK                No-Already have block size
         MVC   BLKSIZE,DCBBLKSI     Save block size
UNBLOCK  DS    0H
         MVC   BLKSIZE,DCBBLKSI     Save block size
         TM    DCBRECFM,DCBRECF     Is it 'Fixed' length records?
         BO    FIXED                  Yes-Go do fixed
         TM    DCBRECFM,DCBRECV     Is it 'Variable' length records?
         BO    VARIABLE               Yes-Go do variable
         B     UNKNOWN                No-Unknown record format
         :
UNDEF    DS    0H
         :
FIXED    DS    0H
         :
VARIABLE DS    0H
         :
THEFILE  DCB   MACRF=GL,DSORG=PS    Minimal Input DCB
         :

That's it. You must be careful with the order of testing for record format. This is because DCBRECU = DCBRECF+DCBRECV. Otherwise, have fun.

George Cleveland
Synergy Software Solutions, Inc.


    >You can get this information from the JFCB (job file control block).  There are
    >other ways as well. You use a RDJFCB (read JFCB) macro to retrieve the
    >information.  The mapping macro for the data is in IEFJFCBN.  Some of the
    >information is not filled in until after the open macro is issued.
    >
    >IBM has all of their manual online now.  Here's an example they give (I modified
    >it to make it less complicated):
    >
    >
    >      EX3       OPEN (INVEN)
    >
    >     EX1       RDJFCB (INVEN)
    >                         .
    >
    >               .
    >     INVEN     DCB      EXLST=LSTA,...
    >
    >     LSTA      DS       0F
    >               DC       X'07'
    >               DC       AL3(JFCBAREA)
    >               .
    >               .
    >               .
    >     JFCBAREA  DS       0F,176C
    >               .
    >               .
    >               .
    >     LSTB      DS       0F
    >               .
    >
    >   Figure 64. Example Code Using RDJFCB Macro
    >
    >
    >The information that you want will be returned in the area designated in the
    >example as JFCBAREA.  Use the mapping macro IEFJFCBN found in either SYS1.MACLIB
    >or SYS1.MODGEN, to find the field names you need.
    >
    >The relevent IBM manual is: DFSMS/MVS V1R4 Using Data Sets, which can be found
    >at:
    >
    >http://www.s390.ibm.com/os390/bkserv/v2r6books.html
    >
    >I hope this helps.
    >
    >John
    >
    >

    >
    >> Please excuse me, I'm a PC Programmer writing a mainframe assembler program.
    >>
    >> If I sound like I don't know what I'm doing, it's because that is true...
    >> I've been learning mainframe assembler on MVS for 3 days, and I have most of
    >> my program working.  However, there are a few details I haven't figured out
    >> yet.
    >>
    >> 1) Is it possible to determine at run-time the block size, record format,
    >> and record length of an input file.  I think this is stored in the DCB data
    >> area, but I haven't found any documentation on this in any of the online
    >> books. (book manager)
    >>
    >> 2) if it is possible to determine these values, how?
    >>
    >> 3) if not, is there any way to get it from JES2?  (is there an api?)
    >>
    >> Thanks for any help...
    >> Please email the reply...
    >>
    >> Feel free to pass on any PC questions you have to me... I am an expert C,
    >> C++, Pascal, x86 Assembler, and VB programmer.
    >>
    >> Kelly Leahy

    >



Thu, 28 Jun 2001 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Please Help to use macro

2. Nasm Macros - For / Next Loop, Help Please

3. MASM Macro help, please

4. Please Help:macro accepting symbols only

5. please, please, please, please, help

6. will someone please, please, please, please HELP me?!!

7. Help with macros writing macros in Bigloo

8. help sought for macro defining macro

9. VSE 3.1 Repository Problem: Please help (please please?)

10. PLEASE PLEASE PLEASE HELP !!!!!!!!!!!!

11. please,please please do help us

12. help please-----please help about array in DLL

 

 
Powered by phpBB® Forum Software