MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Assembler routine for dynamic allocation - No BPXWDYN

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Mon Aug 14, 2006 9:24 pm    Post subject: Assembler routine for dynamic allocation - No BPXWDYN Reply with quote

Hi All
I'm looking for an assembler routine which can be called from a COBOL program for dynamic file allocation. I know BPXWDYN or PUTENV can be used for this purpose. But my requirements are

1. Allocate an input file, which can be FB, FBA,VB etc. with different LRECL
2. Allocate a new output file same as input.
3. Read the input file and based on some process write to Output. The
processing can be done in the calling COBOL program.

So the assembler program will allocate two files one in SHR mode and the other in NEW.Also I would like to know whether the assembler routine can handle VSAM KSDS.
Can somebody please help me.
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
ssd
Beginner


Joined: 24 Mar 2006
Posts: 25
Topics: 10

PostPosted: Mon Aug 14, 2006 11:49 pm    Post subject: Reply with quote

Somuk,

BPXWDYN also enables you do the operations that you had specified.
so you can readily use BPXWDYN module.

refer the following link:
http://publibz.boulder.ibm.com/epubs/pdf/bpxzb651.pdf
for complete BPXWDYN command ref

SSD
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Aug 15, 2006 2:01 am    Post subject: Reply with quote

You'll need to write the assembler to modify the parameter lists as you need, but a basic example of SVC99 is:
Code:
SVCTEST  CSECT ,        Simplified SVC 99 invocation
SVCTEST  AMODE 31       Generated to duplicate SVC
SVCTEST  RMODE 24       call made by ISPF
         BAKR  14,0     02:57 - 08/15/06
         LR    12,15    Run this with TSO PROFILE WTP
         USING SVCTEST,12 -----------------------------------
         LA    1,S99RBPTR             Get addr of parm list
         LR    2,1                    Save R1 for TSO TEST
         SVC   99                     Call Dynalloc
         L     0,S99ERROR             Save error code
         NOPR  0                      Place for TSO test breakpoint
         PR    ,                      Return to caller
S99RBPTR DC A(X'80000000'+S99RB)   Address of request block
S99RB    DC AL1(20),AL1(1),XL2'6400'  Allocate,Flags
S99ERROR DC AL2(0)                    Returned error code
S99INFO  DC AL2(0)                    Returned info code
S99TXTPP DC A(TULIST,EXTBLOCK,0)      Pointer to text units
TU0001   DC X'0001',AL2(1),AL2(8),CL8'ISP02561'    DDNAME
TU0002   DC X'0002',AL2(1),AL2(44),CL44'USER1.PRIVATE.COBOL' DSname
TU0003   DC X'0004',AL2(1),AL2(1),X'08'            Status SHR
TU0004   DC X'0005',AL2(1),AL2(1),X'08'            Norm disp KEEP
TU0005   DC X'0006',AL2(1),AL2(1),X'08'            Cond disp KEEP
TU0006   DC X'0010',AL2(1),AL2(6),CL6'CPDLB1'      Volser
TU0007   DC X'0015',AL2(1),AL2(8),CL8'3390'        Unit
TU0008   DC X'0052',AL2(0)                         Perm
TU0009   DC X'0056',AL2(1),AL2(44),CL44' '         Ret DSN
TU0010   DC X'0057',AL2(1),AL2(2),X'0000'          Ret DSORG
TU0011   DC X'005D',AL2(1),AL2(6),CL6' '           Ret volsr
TULIST   DC A(TU0001,TU0002,TU0003,TU0004,TU0005,TU0006,TU0007,TU0008)
         DC A(TU0009,TU0010,TU0011+X'80000000')
EXTBLOCK DC CL6'S99RBX',X'01',X'C4',XL200'00'  Ext. block.
         END SVCTEST
Back to top
View user's profile Send private message Visit poster's website
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Tue Aug 15, 2006 6:54 am    Post subject: Reply with quote

Thanks semigeezer. I have very little knowledge in Assembler. The reason I have asked for an Assembler routine is, I know it's the best option for dynamic file allocation compared to BPXWDYN. Since it does not have any bottleneck like FB, VB and the LRECL.
How do we make it to accept the file name and the other parameter dynamically?.I'm sorry to bother you with the basic questions.
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Aug 15, 2006 7:59 am    Post subject: Reply with quote

Hi Somuk. Like ssd said, BPXWDYN is a direct interface to the same dynamic allocation as I've shown in the assembler. The results are a little bit harder to diagnose sometimes because return codes are a little harder to follow, but it is really the same thing. I would suggest using BPXWDYN if you can because then you don't need to manipulate these error prone data structures.
Back to top
View user's profile Send private message Visit poster's website
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Tue Aug 15, 2006 9:33 am    Post subject: Reply with quote

Hi semigeezer,
I have checked for BPXWDYN before looking for an assembler option. But the problem is I need to have a properly defined FD section in my COBOL program. Like the one discussed here.
http://www.mvsforums.com/helpboards/viewtopic.php?t=4572&highlight=string+pointer
But I want to handle any type of VB and FB files with any lengths. That was the reason I specifically opted for an assembler routine.
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Aug 15, 2006 9:41 am    Post subject: Reply with quote

Even with dynamic allocation you must still have an FD section. Dynamic allocation only handles the allocation, connecting the file to your FD. It is handy when the DSNAME and related info is changeable.

For handling various record formats, you'll need to modify the DCB structure that underlies the FD. I'm not sure if this has ever been discussed in this forum but there is probably a way to address the FD and move in new format values.

I've done this in Assembler, but not COBOL.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Tue Aug 15, 2006 10:32 am    Post subject: Reply with quote

Bill
I'm looking for an assembler routine that can be called from a COBOL program. I checked in Cbttape and found a couple of them but did not get the proper information like how do we call it from a sample COBOL program etc..
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Mon Aug 28, 2006 5:26 am    Post subject: Reply with quote

Use DYNALLOC, see

MVS/ESA

Application Development Guide:
Authorized Assembler Language Programs

MVS/ESA System Product:
JES2 Version 4
JES3 Version 4

Document Number GC28-1645-05

Program Number
5695-047
5695-048

File Number S370/S390-40
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Wed Jun 13, 2007 2:04 am    Post subject: Reply with quote

see http://www.mvsforums.com/helpboards/viewtopic.php?t=8561
Back to top
View user's profile Send private message
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Wed Jul 11, 2007 5:07 am    Post subject: Reply with quote

Somu,
I think allocation and file open close is a different thing. i guess you are confused with macro DYNALLOC and DCB.
Allocation does not bother about the DCB structure as Billy Dennis said.

The FD entries in COBOL i think will be used when the data set actually opens.
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group