IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Dynamically allocating a new PS file in Assembler


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bharath_gct2002

New User


Joined: 08 Oct 2007
Posts: 27
Location: Dallas, TX

PostPosted: Tue Mar 11, 2008 7:26 pm
Reply with quote

I have a code in Assembler in which a file is being dynamically created. The code is running fine in production creating a new file. But I wanted to modify the code so that I should add a Retention period for the dynamically for the newly created file. I tried giving the RETPD for the file in JCL but that doesnt turn to work out as the file is getting creted dynamically.

The portion in the code where the file is allocated dynamically is:

Code:

*                                                                       00026100
*  DYANMICALLY ALLOCATE THE OUTPUT FILE                                 00026200
*                                                                       00026300
         L     R9,=F'12'                 ASSUME FAILURE                 00026400
         XC    RBXAREA,RBXAREA           CLEAR                          00026500
         LA    R3,RBXAREA                AREA FOR RBX                   00026600
         USING S99RBX,R3                                                00026700
         MVC   S99EID,XID                EXTENSION ID                   00026800
         OI    S99EVER,S99RBXVR          S99RB VERSION                  00026900
         OI    S99EOPTS,S99EIMSG         INDICATE RETURN MESSAGE        00027000
         OI    S99EOPTS,S99EWTP          INDICATE RETURN AS WTO         00027100
         OI    S99EMGSV,S99XINFO         MIN ERROR LEVEL TO PROCESS     00027200
*                                                                       00027300
         XC    RBPAREA,RBPAREA           CLEAR                          00027400
         LA    R8,RBPAREA                AREA FOR RBPTR                 00027500
         USING S99RBP,R8                                                00027600
         LA    R4,S99RBPTR+4             PAST S99RBPTR TO RB            00027700
         USING S99RB,R4                                                 00027800
         ST    R4,S99RBPTR               SET REQUEST RBPTR              00027900
         OI    S99RBPTR,S99RBPND         SET HIGH-ORDER BIT IN RBPTR    00028000
         XC    S99RB(RBLEN),S99RB        CLEAR                          00028100
         MVI   S99RBLN,RBLEN             SET LENGTH                     00028200
         MVI   S99VERB,S99VRBAL          ALLOCATION                     00028300
         ST    R3,S99S99X                ADDR OF RBX                    00028400
         LA    R5,S99RB+RBLEN            PAST RB TO TU                  00028500
         USING S99TUPL,R5                                               00028600
         ST    R5,S99TXTPP               SET ADDR OF TU LIST IN RB      00028700
*                                                                       00028800
         MVC   DYNADSN,ALDSNAM           FORMAT WITH PATTERN            00028900
         LA    R6,DYNADSN                PASS DSNAME                    00029000
         MVC   6(44,R6),GDGPODSN         FORMAT WITH DSNAME             00029100
         ST    R6,S99TUPTR               STORE IN TU LIST               00029200
         LA    R5,S99TUPL+4              NEXT TU ENTRY                  00029300
*                                                                       00029400
         MVC   DYNALIKE,ALLIKE           FORMAT WITH PATTERN            00029500
         LA    R6,DYNALIKE               LIKE INPUT DSNAME              00029600
         MVC   6(44,R6),GDGPIDSN         FORMAT WITH DSNAME             00029700
         ST    R6,S99TUPTR               STORE IN TU LIST               00029800
         LA    R5,S99TUPL+4              NEXT TU ENTRY                  00029900
*                                                                       00030000
         MVC   DYNASTAT,ALSTATS          FORMAT WITH PATTERN            00030100
         LA    R6,DYNASTAT               PASS STATUS                    00030200
         MVI   6(R6),X'04'               NEW                            00030300
         ST    R6,S99TUPTR               STORE IN TU LIST               00030400
         LA    R5,S99TUPL+4              NEXT TU ENTRY                  00030500
*                                                                       00030600
         MVC   DYNADISP,ALNDISP          FORMAT WITH PATTERN            00030700
         LA    R6,DYNADISP               PASS DISP                      00030800
         MVI   6(R6),X'02'               CATLG                          00030900
         ST    R6,S99TUPTR               STORE IN TU LIST               00031000
         LA    R5,S99TUPL+4              NEXT TU ENTRY                  00031100
*                                                                       00031200
         MVC   DYNADDN,ALRTDDN           FORMAT WITH PATTERN            00031300
         LA    R6,DYNADDN                RETURNED DDNAME                00031400
         ST    R6,S99TUPTR               STORE IN TU LIST               00031500
         LA    R5,S99TUPL+4              NEXT TU ENTRY                  00031600
*                                                                       00031700
         MVC   DYNAVOL,ALRTVOL           FORMAT WITH PATTERN            00031800
         LA    R6,DYNAVOL                RETURNED VOL=SER               00031900
         ST    R6,S99TUPTR               STORE IN TU LIST               00032000
*                                                                       00032100
         LR    R6,R5                                                    00032200
         USING S99TUNIT,R6                                              00032300
         OI    S99TUPTR,S99TUPLN         SET END OF LIST                00032400
         DROP  R3,R4,R5,R6                                              00032500
*                                                                       00032600
         LR    R1,R8                     PLIST IN R1                    00032700
*                                                                       00032800
         DYNALLOC                        PROCESS THE REQUEST            00032900
         C     R15,=F'0'                 SUCCESS?                       00033000
         BE    DYNAOK02                  YES                            00033100
         B     PGMEXIT                   NO                             00033200
*                                                                       00033300
DYNAOK02 L     R9,=F'0'                  INIT                           00033400
         LA    R6,GDGPODDN               DDNAME TO BE USED IN OPEN      00033500
         LA    R7,DYNADDN                DDNAME RETURNED                00033600
         MVC   0(8,R6),6(R7)             FORMAT DDNAME FOR RETURN       00033700
*                                                                       00033800
         LA    R6,GDGPOVOL               TO BE USED LATER               00033900
         LA    R7,DYNAVOL                VOL=SER RETURNED               00034000
         MVC   0(6,R6),6(R7)             FORMAT VOL=SER                 00034100
*                                                                       00063100


and my Storage Declarations are in the attachment (Definitions.txt). I have also attached the above code (DYNALLOC.txt).

I could see the parameters passed to this file like DISP, VOLUME are passed with some hex values like X'02' and X'04'.

I am not familiar much on Dynamic file handling in Assembler. Any help to add a RETPD parameter of 2 days to the above code would be really grateful.

Regards,
Bharath
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Mar 11, 2008 9:21 pm
Reply with quote

OK, dumb question time again. icon_confused.gif

With all of the existing utilities provided by IBM for dynamic file allocations (ALLOCATE and BPXWDYN), is there a really good reason to "re-invent the wheel" like this?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Mar 11, 2008 9:55 pm
Reply with quote

a standards issue...
retention period is something that is being frowned upon by many/MOST organization
with SMS all the data management issues should be tackled by the proper SMS constructs
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top