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 

I am getting U4038 abend with file status code 39

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


Joined: 13 Sep 2004
Posts: 33
Topics: 16

PostPosted: Mon Sep 20, 2004 6:01 am    Post subject: I am getting U4038 abend with file status code 39 Reply with quote

Hi,

please help me how to solve this abend.
my requirement is one vsam esds file reading and writing into a flat file all the records. logical file in cobol and physical file in jcl lengths are same also i am getting this problem and i am getting in sysout genk value why it is coming please help me.
By
Pgorthi Embarassed Razz
Back to top
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Sep 20, 2004 6:34 am    Post subject: Reply with quote

pgorthi,

File status code of 39 means A conflict has been detected between the fixed file attributes and the attributes specified for the file in the program. This is usually caused by a conflict with record-length, key-length, key-position or file organization.
Other possible causes are:

1. Alternate indexes are incorrectly defined.
2. The Recording Mode is Variable or Fixed or not defined the same as when the file was created.


Post your file declaration and the open statement. Also let us know the type of vsam cluster(ESDS, KSDS, RRDS, LDS)

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pgorthi
Beginner


Joined: 13 Sep 2004
Posts: 33
Topics: 16

PostPosted: Mon Sep 20, 2004 8:55 am    Post subject: Reply with quote

Hi,

here i am sending my cobol program and every thing please let me know what is the problem.

COBOL program:
Code:

IDENTIFICATION DIVISION.
       PROGRAM-ID. COBEX1.
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
            SELECT A-ESDS-FILE ASSIGN TO DA-AESDSFI
            ORGANIZATION IS SEQUENTIAL
            ACCESS MODE IS SEQUENTIAL
            FILE STATUS ESDS-ST.
            SELECT B-BSAM-FILE ASSIGN TO BBSAMFI.
       DATA DIVISION.
       FILE SECTION.
       FD A-ESDS-FILE.
      *     RECORDING MODE IS F
      *     RECORD CONTAINS 80 CHARACTERS
      *     BLOCK CONTAINS 0 RECORDS.
       01 A-REC.
          05 A-NAME          PIC A(20).
          05 A-AGE           PIC 9(3).
          05 FILLER          PIC X(57).
       FD B-BSAM-FILE.
      *     RECORDING MODE IS F
      *     RECORD CONTAINS 80 CHARACTERS
      *     BLOCK CONTAINS 0 RECORDS.
       01 B-REC.
          05 B-NAME          PIC A(20).
          05 B-AGE           PIC 9(3).
          05 FILLER          PIC X(57).
       WORKING-STORAGE SECTION.
       01 NO-MORE-RECORDS    PIC A(3) VALUE 'YES'.
       01 ESDS-ST            PIC X(02).
       PROCEDURE DIVISION.
       1000-MAIN-PARA.
            OPEN INPUT A-ESDS-FILE
              OUTPUT B-BSAM-FILE.
            DISPLAY ESDS-ST.
            PERFORM 1500-READ-PARA
               THRU 1500-READ-PARA-EXIT
              UNTIL NO-MORE-RECORDS = 'NO'.
            DISPLAY 'O GOD PLEASE HELP'.
            DISPLAY ESDS-ST.
            CLOSE A-ESDS-FILE
                  B-BSAM-FILE.
            STOP RUN.
       1000-MAIN-PARA-EXIT.
            EXIT.
       1500-READ-PARA.
            READ A-ESDS-FILE AT END MOVE 'NO' TO NO-MORE-RECORDS.
            IF NO-MORE-RECORDS = 'YES'
            PERFORM 2000-B-WRITE-PARA
               THRU 2000-B-WRITE-PARA-EXIT.
       1500-READ-PARA-EXIT.
            EXIT.
       2000-B-WRITE-PARA.
            MOVE A-REC TO B-REC.
            DISPLAY A-NAME.
            DISPLAY A-AGE.
            WRITE B-REC.
       2000-B-WRITE-PARA-EXIT.
            EXIT.

Using this jcl i created ESDS file:

           //ISCP02AT JOB (TTSOMFG0,OFF,1440,0050,0050),'PANI',
//             REGION=0008192K,MSGCLASS=X,CLASS=1,NOTIFY=&SYSUID
//DEFESDS EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
  DEFINE CLUSTER +
    (NAME(ISCP02.VSAM.ESDS2) +
    RECORDSIZE(80,80) +
    NONINDEXED) +
    DATA (NAME(ISCP02.VSAM.ESDS2.DATA) +
    CYLINDERS(3 1))
/*

using this job i run my program:

//ISCP02AT JOB (TTSOMFG0,OFF,1440,0050,0050),'PANI',                    00001000
//             REGION=0008192K,MSGCLASS=X,CLASS=1,NOTIFY=&SYSUID       
//STEP1   EXEC PGM=COBEX1                                               
//STEPLIB   DD DSN=ISCP02.TEST.LOADLIB,DISP=SHR                         
//AESDSFI   DD DSN=ISCP02.VSAM.ESDS2,DISP=SHR                           00001421
//BBSAMFI   DD DSN=ISCP02.TEST.BFILE,DISP=OLD                           
//*         SPACE=(TRK,(1,1),RLSE)                                     
//SYSPRINT  DD SYSOUT=*                                                 
//SYSOUT    DD SYSOUT=*                                                 
//                       

here i send my code please solve my problem.

by
Pgorthi
Back to top
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Sep 20, 2004 9:26 am    Post subject: Reply with quote

Pgorthi,

Did your code even compile? You defined A-NAME as PIC A(20). The same is for B-name and no-more-records variables. There is no such definition as A(20). It should be X(20). Your actual problem is with assign clause.

When you define an ESDS file in CObol you need to define with AS in the assign clause.

So change your asssign clause for your input esds from

Code:

SELECT A-ESDS-FILE ASSIGN TO DA-AESDSFI


to
Code:

SELECT A-ESDS-FILE ASSIGN TO AS-AESDSFI


and re-run the program

Also chec this link for a better understanding of processing vsam files.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/1.10?DT=20020923143836



Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pgorthi
Beginner


Joined: 13 Sep 2004
Posts: 33
Topics: 16

PostPosted: Tue Sep 21, 2004 5:57 am    Post subject: Reply with quote

Hi Kolusu,

thanks a lot kolusu i wrote in select clause instead of DA-AESDSFI, i over write AS-AESDSFI then it working fine if possible please give me suggestions for
KSDS and RRDS what i want to write in select clause logocal name naming standerd.

thanks a lot kolusu.
By
Pgorthi
Back to top
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Sep 21, 2004 7:30 am    Post subject: Reply with quote

Quote:

please give me suggestions for KSDS and RRDS what i want to write in select clause logocal name naming standerd.


pgorthi,

Did you go thru the manual posted in my previous response? The manual explains in detail about processing of vsam files

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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