home made program to allocate a dataset



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

home made program to allocate a dataset

Postby samb01 » Wed Sep 17, 2014 2:57 pm

Heelo,

we use a home made programm to allocate a sequential dataset :

QA0009   STARTOS                                         
         OPEN  (OUT,(OUTPUT))                           
         CLOSE OUT                                       
         RETOS                                           
OUT      DCB   DSORG=PS,DDNAME=OUT,MACRF=PM             
         END                                             



Here is an example in the JCL

//ALLOC   EXEC PGM=Q0009                     
//OUT    DD DISP=(,CATLG,KEEP),             
//       DSN=FILE.DATASET,             
//       SPACE=(TRK,(1,1)),RECFM=FB,LRECL=80



I would like to know what is the différence with the ibm program : IEFBR14 which allow te create a sequential dataset too.
samb01
 
Posts: 431
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: home made program to allocate a dataset

Postby steve-myers » Wed Sep 17, 2014 3:20 pm

IEFBR14 does nothing in the program.

Your little program effectively writes a DASD end of data to the data set. This is entirely unnecessary with an SMS managed data set; allocation already does this, but it is moderately useful with non-SMS managed sequential data sets as it will prevent ordinary programs from reading any previous contents of the data set.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: home made program to allocate a dataset

Postby enrico-sorichetti » Wed Sep 17, 2014 3:31 pm

You are missing a point here ....
it is JCl ( as the set of system functions that process the JCL statements ) that does it

when processing the DDs JCL does not care about the program that is executed later on

a bit of history ...

once upon a time when allocating a PS dataset only CATALOG and VTOC were <updated>
so the data extent was left untouched with nasty consequences ( like processing later on leftover data )

with SMS now when allocating a PS dataset data management writes an end of file leaving things in a clean state

probably Your program was a circumvention for the above problem
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
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: home made program to allocate a dataset

Postby samb01 » Wed Sep 17, 2014 5:32 pm

OK,

thank's for your help.

It is a very old program we are using actually to allocate dataset.
But i wonder if it is useful yet.

By reading your answers, il anderstand we don't have to continue using this program because of SMS.
samb01
 
Posts: 431
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: home made program to allocate a dataset

Postby enrico-sorichetti » Wed Sep 17, 2014 6:13 pm

By reading your answers, il anderstand we don't have to continue using this program because of SMS.


remember ... the EOF write works only for SMS managed datasets
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
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: home made program to allocate a dataset

Postby steve-myers » Wed Sep 17, 2014 9:24 pm

samb01 wrote:... It is a very old program we are using actually to allocate dataset. ...
Your little program does not actually allocate the data set; your JCL actually allocates the data set; Mr. Sorichetti and I have described the effect of what your little program actually does. Nevertheless, your little program has some actual problems.
  • It can actually ABEND. For example,
    //INIT    EXEC PGM=Q0009         
    //OUT      DD  DISP=(,CATLG,KEEP),
    //             DSN=FILE.DATASET, 
    //             SPACE=(TRK,(1,1)),
    //             UNIT=SYSDA
    will ABEND because the data set has no DCB attributes.
  • This is a minor problem; it has no effect in the real world because end of task processing does the equivalent. The program does not free the buffer pool allocated when it opened the data set. The reason is something appreciated (or, mostly, remembered) by us dinosaurs. One of the truly odd capabilities of OS/360 data management is the ability for several DCBs to share a buffer pool. Since another DCB might be using the buffers, CLOSE can't free them; your program must free them. IBM provides a macro, FREEPOOL, that actually frees the buffer pool. Now life isn't perfect. Until fairly recently FREEPOOL didn't bother to test if there was a buffer pool to free, and it would ABEND, usually while trying to calculate the size of the non existent buffer pool, so us dinosaurs usually add two lines of code before the FREEPOOL macro to see if there is a buffer pool to free.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post