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 writing a Dummy record.

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


Joined: 11 Dec 2004
Posts: 103
Topics: 39

PostPosted: Thu Mar 10, 2005 5:58 pm    Post subject: Assembler routine for writing a Dummy record. Reply with quote

Hi Friends,

I have this cute little problem.

I have a Driver Program in PL/I which has a file to be declared in Update Mode in the beginning. This file will be called later in other PL/I subroutines from this driver and data will be writted using WRITE.

This file is already created in some other process. This Driver Pl/I program just takes it.
Now the issue is in the Driver , since i do not have any Data in this file i cannot declare it in the Update mode ( which i have to ).

I have heard that in using an assembler routine i can write a DUMMY record to this file so i wont get any ONCODE error in this file.

Please share with me the assembler routine if any body has.

Thanks in Advance,
Karun.
Back to top
View user's profile Send private message Send e-mail
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Fri Mar 11, 2005 11:10 am    Post subject: Reply with quote

I am not familiar with PL1, so am not sure what an ONCODE errors is. If you are looking for a routine which adds a dummy record to a KSDS VSAM file, and then deletes it so that the file is "initilized", let me know. I can provide that.

DTF
________
synthetic weed


Last edited by dtf on Tue Feb 01, 2011 1:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
karunkallore
Beginner


Joined: 11 Dec 2004
Posts: 103
Topics: 39

PostPosted: Fri Mar 11, 2005 1:36 pm    Post subject: Exactly thatz what i requested... Reply with quote

Hi,

You got my Problem exactly Very Happy .

Yes, Can you please provide me with a Routine which will write a Dummy record to a KSDS VSAM file and then deletes so that the file is "initialised".

This is beacause i need that file to be declared in UPDATE mode in my PL/I driver program. If i do not initialise i will get a ONCODE for that file.

By the way is this an assembler program ?
Also in my JCL can i just execute this program in the Step Prior to the Step where i am calling my PL/I routine ?

Thanks in advance for the Help.

Karun.
Back to top
View user's profile Send private message Send e-mail
karunkallore
Beginner


Joined: 11 Dec 2004
Posts: 103
Topics: 39

PostPosted: Mon Mar 14, 2005 8:53 am    Post subject: Hi DTF.. Reply with quote

Hi DTF...

Can you please help me and pass on the routine to write initialise a KSDS file.


Thanks in advance,
Karun !
Back to top
View user's profile Send private message Send e-mail
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Mon Mar 14, 2005 5:41 pm    Post subject: Reply with quote

Karun
Check for File 183 in http://cbttape.org/.
Hope this help
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Mon Mar 14, 2005 10:59 pm    Post subject: Reply with quote

Sorry,

I have been out of town for a few days. I will try to post the routine tomorrow


DTF
________
hotels in mexico


Last edited by dtf on Tue Feb 01, 2011 1:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Mon Mar 14, 2005 11:29 pm    Post subject: Reply with quote

This should do it.......

Code:
VSAMINIT CSECT                                                          00001
*********************************************************************** 00002
*    DP0500 (VSAMINIT) OPENS A DATASET FOR OUTPUT, VERIFIES THAT IT   * 00003
*    IS EMPTY, AND WRITES A DUMMY RECORD.  THE DATASET IS THEN CLOSED * 00004
*    AND RE-OPENED, THIS TIME FOR UPDATE.  THE DUMMY RECORD IS DELETED* 00005
*    AND THE FILE CLOSED.  THIS PROCESS ALLOWS CICS TO ACCESS THE FILE* 00006
*    FOR UPDATE EVEN THOUGH THERE ARE NO RECORDS IN THE DATASET.      * 00007
*                                                                     * 00008
*    DP0500 (VSAMINIT) IS EASY TO USE.  YOU NEED ONLY TO SUPPLY A     * 00009
*    SYSOUT DD STATEMENT AND A KSDS DD STATEMENT POINTING TO THE      * 00010
*    DATASET TO BE INITIALIZED.  BECAUSE DP0500 (VSAMINIT) RETRIEVES  * 00011
*    THE RECORD LENGTH FROM THE CATALOG, THE PROGRAM DOES NOT NEED    * 00012
*    TO BE REASSEMBLED FOR EACH KSDS.  DP0500 (VSAMINIT) ALSO WORKS   * 00013
*    ON ALTERNATE INDEXES.  FIRST DEFINE AND INITIALIZE THE BASE      * 00014
*    CLUSTER, THEN DEFINE AND INITIALIZE THE ALTERNATE INDEX.         * 00015
*                                                                     * 00016
*    **NOTE : AS STATED IN THE SECOND PARAGRAPH, A KSDS DD STATEMENT  * 00021
*      IS NEEDED.  THIS NOT ONLY MEANS THAT THE DSN MUST BE A KSDS    * 00022
*      FILE, BUT ALSO MEANS THAT THE DDNAME IN THE JCL MUST BE 'KSDS'.* 00023
*                                                                     * 00024
*********************************************************************** 00030
*    REGISTER EQUATES AND USAGE                                       * 00031
*********************************************************************** 00032
R0       EQU   0                                                        00033
R1       EQU   1                                                        00034
R2       EQU   2                                                        00035
R3       EQU   3                                                        00036
R4       EQU   4                                                        00037
R5       EQU   5                                                        00038
R6       EQU   6                                                        00039
R7       EQU   7                                                        00040
R8       EQU   8                                                        00041
R9       EQU   9                                                        00042
R10      EQU   10                                                       00043
R11      EQU   11                                                       00044
R12      EQU   12                                                       00045
R13      EQU   13                                                       00046
R14      EQU   14                                                       00047
R15      EQU   15                                                       00048
*********************************************************************** 00049
         PRINT NOGEN
         STM   R14,R12,12(R13)     SAVE REGISTERS                       00050
         LR    R11,R15             SET BASE REG FROM ENTRY ADDRESS      00051
         USING DP0500,R11          ADDRESSABILITY FOR ASSEMBLER         00052
         ST    R13,SAVE+4          STORE BACKWARD SAVE AREA POINTER     00053
         LA    R14,SAVE            ADDRESS CURRENT SAVE AREA            00054
         ST    R14,8(R13)          STORE FORWARD SAVE AREA POINTER      00055
         LR    R13,R14             PUT SAVE AREA ADDRESS IN R13         00056
* OPEN MSG DATASET AND KSDS                                             00057
* TEST TO SEE IF DATASET IS UNLOADED                                    00058
* GET LRECL                                                             00059
         OPEN  (MSGDCB,OUTPUT)                                          00060
         OPEN  BLOCK               OPEN KSDS OUTPUT SEQUENTIAL          00061
         LA    R7,OPERR            POINT TO OPEN ERROR                  00062
         LTR   R6,R15              GOOD OPEN?                           00063
         BNZ   NOCLOSE             NO...PUT ERROR, DON'T CLOSE KSDS     00064
         SHOWCB ACB=BLOCK,         GET NUMBER OF LOGICAL RECORDS       X00065
               AREA=DISPLAY,       AND LRECL                           X00066
               FIELDS=(NLOGR,LRECL),                                   X00067
               LENGTH=8                                                 00068
         LA    R7,SHOWERR          POINT TO SHOWCB ERROR                00069
         LTR   R6,R15              SUCCESSFUL SHOWCB?                   00070
         BNZ   END                 NO...PUT ERROR                       00071
         LA    R7,DATAFND          POINT TO DATA FOUND                  00072
         CLC   NLOGR,=F'0'         IS DATASET EMPTY?                    00073
         BNE   END                 NO, PUT ERROR                        00074
* GETMAIN RECORD AREA AND THEN ZERO THE AREA                            00075
* PUT THE DUMMY RECORD AND CLOSE THE KSDS                               00076
         L     R0,LRECL            PUT LENGTH IN REG 0                  00077
         GETMAIN R,LV=(0)          ZERO RECORD AREA AND PUT             00078
         LR    R2,R1               LOAD RECORD AREA ADDRESS             00079
         L     R3,LRECL            LRECL FROM ACB                       00080
         SR    R5,R5               ZERO REGS FOR MVCL                   00081
         MVCL  R2,R4               ZERO RECORD AREA                     00082
         LR    R2,R1               RESTORE RECORD AREA ADDRESS          00083
         L     R3,LRECL            RESTORE LRECL                        00084
         MODCB RPL=LIST,                                               X00085
               AREA=(2),                                               X00086
               AREALEN=(3),                                            X00087
               RECLEN=(3)                                               00088
         LA    R7,MODERR           POINT TO MOD RPL ERROR               00089
         LTR   R6,R15              SUCCESSFUL MODCB?                    00090
         BNZ   END                 NO...PUT ERROR                       00091
         PUT   RPL=LIST            WRITE DUMMY RECORD                   00092
         LA    R7,PUTERR           POINT TO PUT ERROR                   00093
         LTR   R6,R15              GOOD PUT?                            00094
         BNZ   ERROR               NO...GET FEEDBACK CODE               00095
         CLOSE BLOCK               CLOSE KSDS                           00096
         LA    R7,CLOSERR          POINT TO CLOSE ERROR                 00097
         LTR   R6,R15              GOOD CLOSE?                          00098
         BNZ   NOCLOSE             NO...DON'T TRY TO CLOSE AGAIN        00099
* OPEN THE KSDS AGAIN AND THEN MODIFY THE REQUEST                       00100
* PARAMETER LIST TO SHOW UPDATE INTENT                                  00101
* GET THE FIRST RECORD WHICH IS THE DUMMY RECORD                        00102
         OPEN  BLOCK               OPEN KSDS AGAIN                      00103
         LA    R7,OPERR2           POINT TO SECOND OPEN ERROR           00104
         LTR   R6,R15              TEST FOR GOOD OPEN                   00105
         BNZ   NOCLOSE             NO...PUT ERROR                       00106
         MODCB RPL=LIST,           CHANGE RPL TO UPDATE INTENT         X00107
               OPTCD=(UPD)                                              00108
         LA    R7,MODERR           POINT TO MOD RPL ERROR               00109
         LTR   R6,R15              TEST FOR GOOD MODIFY                 00110
         BNZ   END                 NO...PUT ERROR                       00111
         GET   RPL=LIST            GET FOR UPDATE                       00112
         LA    R7,GETERR           POINT TO GET ERROR                   00113
         LTR   R6,R15              GOOD RETRIEVAL?                      00114
         BNZ   ERROR               NO...GET FEEDBACK CODE               00115
* DELETE THE DUMMY RECORD, PRINT THE STATUS MESSAGE,                    00116
* CLOSE THE DATASETS AND RETURN                                         00117
         ERASE RPL=LIST            DELETE THE RECORD                    00118
         LA    R7,ERASERR          POINT TO ERASE ERROR                 00119
         LTR   R6,R15              GOOD DELETE?                         00120
         BNZ   ERROR               NO...GET FEEDBACK CODE               00121
         LA    R7,NORMAL           POINT TO NORMAL END OF TASK          00122
END      EQU   *                                                        00123
         CLOSE BLOCK               CLOSE KSDS                           00124
NOCLOSE  EQU   *                                                        00125
         PUT   MSGDCB,0(R7)        PRINT MESSAGE                        00126
         CLOSE MSGDCB              CLOSE MESSAGE DATASET                00127
         LR    R15,R6              PUT SEVERITY CODE IN R15             00128
         L     R13,SAVE+4          POINT TO PREVIOUS SAVE AREA          00129
         RETURN (14,12),RC=(15)    RETURN BACK TO SYSTEM                00130
* ERROR HANDLING ROUTINE FOR GET PUT ERASE                              00131
ERROR    EQU   *                                                        00132
         SHOWCB RPL=LIST,          GET FEEDBACK CODE                   X00133
               FIELDS=FDBK,                                            X00134
               AREA=FDBKCDE,                                           X00135
               LENGTH=4                                                 00136
         PUT   MSGDCB,0(R7)        PRINT ERROR MESSAGE                  00137
         UNPK  WKFLD,FDBKCDE+2(3)  FORMAT FEEDBACK CODE                 00138
         TR    WKFLD(3),TRTBL-C'0' CHANGE X'FA-FF' TO C'A-F'            00139
         MVC   MSGCDE,WKFLD        MOVE TO MESSAGE LINE                 00140
         LA    R7,MSGFDBK          POINT TO FEEDBACK MESSAGE            00141
         B     END                 PRINT MESSAGE AND EXIT               00142
SAVE     DS    18F                                                      00143
DISPLAY  DS    0D                                                       00144
NLOGR    DS    F                                                        00145
LRECL    DS    F                                                        00146
FDBKCDE  DS    F                                                        00147
         DS    C                   EXTRA BYTE FOR UNPACK                00148
WKFLD    DS    CL4                                                      00149
OPERR    DC    CL80'ERROR OPENING KSDS'                                 00150
OPERR2   DC    CL80'ERROR ON SECOND KSDS OPENING'                       00151
SHOWERR  DC    CL80'SHOWCB FAILED'                                      00152
DATAFND  DC    CL80'KSDS CONTAINS DATA - NO ACTION'                     00153
PUTERR   DC    CL80'UNABLE TO ADD DUMMY RECORD'                         00154
CLOSERR  DC    CL80'UNABLE TO CLOSE KSDS'                               00155
MODERR   DC    CL80'UNABLE TO MODIFY REQUEST PARAMETER LIST'            00156
GETERR   DC    CL80'UNABLE TO RETRIEVE DUMMY RECORD'                    00157
ERASERR  DC    CL80'UNABLE TO DELETE DUMMY RECORD'                      00158
NORMAL   DC    CL80'NORMAL END OF TASK'                                 00159
MSGFDBK  DS    0CL80                                                    00160
         DC    C'VSAM FEEDBACK CODE IS '                                00161
MSGCDE   DS    CL3                                                      00162
         DC    CL(L'MSGFDBK-(*-MSGFDBK))' '                             00163
TRTBL    DC    C'0123456789ABCDE'                                       00164
         LTORG                                                          00165
BLOCK    ACB   DDNAME=KSDS,                                            X00166
               MACRF=(KEY,SEQ,OUT)                                      00167
LIST     RPL   ACB=BLOCK,                                              X00168
               OPTCD=(KEY)                                              00169
MSGDCB   DCB   BLKSIZE=80,                                             X00170
               LRECL=80,                                               X00171
               DDNAME=SYSOUT,                                          X00172
               DSORG=PS,                                               X00173
               MACRF=PM,                                               X00174
               RECFM=F                                                  00175
         END                                                            00176
 

________
FIX PS3


Last edited by dtf on Tue Mar 15, 2011 5:01 am; edited 1 time in total
Back to top
View user's profile Send private message
karunkallore
Beginner


Joined: 11 Dec 2004
Posts: 103
Topics: 39

PostPosted: Wed Mar 16, 2005 11:55 am    Post subject: Thanks a Lot .. Reply with quote

Thank you very much DTF for the code.
Back to top
View user's profile Send private message Send e-mail
karunkallore
Beginner


Joined: 11 Dec 2004
Posts: 103
Topics: 39

PostPosted: Wed Mar 16, 2005 11:56 am    Post subject: Help Somu.. Reply with quote

Hi Somu,

I checked the file 183. But which format is it ? If shows XMI. Which program could i use to open it.

Regards,

Karun
Back to top
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Wed Mar 16, 2005 3:40 pm    Post subject: Reply with quote

Check out this link http://cbttape.org/cbtdowns.htm

You must have missed it before. Wink
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
karunkallore
Beginner


Joined: 11 Dec 2004
Posts: 103
Topics: 39

PostPosted: Wed Mar 16, 2005 3:47 pm    Post subject: Thanks.. Reply with quote

Yeah kind of missed it Wink Thanks Merv !!
Back to top
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Wed Mar 16, 2005 3:56 pm    Post subject: Reply with quote

I find XMIT Manager very useful for viewing .XMI files on the PC. You can download that from the page above, too (it's way over at the top left).
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Thu Mar 17, 2005 9:29 am    Post subject: Reply with quote

Karun
Check the member INITKSDS in File 183. I forgot to mention it in my previous post.
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
karunkallore
Beginner


Joined: 11 Dec 2004
Posts: 103
Topics: 39

PostPosted: Mon Mar 21, 2005 10:37 am    Post subject: Thanks... Reply with quote

Thanks Somu.
Back to top
View user's profile Send private message Send e-mail
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