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

Comparing file format of variable files


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Paul1983

New User


Joined: 08 Jul 2008
Posts: 37
Location: bangy

PostPosted: Fri Oct 17, 2008 4:16 pm
Reply with quote

Hi,

I have a variable file F1.When I'm rewriting this file and trying to clone it, it's abending. When I tried to clone the same file before rewriting it's getting cloned.Pls tell how to compare two variable files, so that I can check whether any format changed after rewriting this file.

3.13 will do only data compare.

Thanks,
Paul
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Oct 17, 2008 4:57 pm
Reply with quote

What do you mean by cloning the file? Copying it? If so, rewrite would NOT be the right thing to do -- rewrite merely replaces an existing record in the file and does not create a copy.

And what do you mean by "whether any format changed"? Files don't have formats -- files have data. ISPF option 3.13 will do data compares and tell you the differences between two files.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Oct 17, 2008 5:06 pm
Reply with quote

Also, what do you mean by "variable file"? A file with variable length records?
Back to top
View user's profile Send private message
Paul1983

New User


Joined: 08 Jul 2008
Posts: 37
Location: bangy

PostPosted: Fri Oct 17, 2008 5:24 pm
Reply with quote

Cloning means copying only..As per my requirement I want to rewrite the file,then copy it.

By format I meant whether the LRECL of the file.

By variable file I meant a file variable length records.

Thanks,
Paul
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Oct 17, 2008 5:31 pm
Reply with quote

Quote:
so that I can check whether any format changed after rewriting this file.
followed by
Quote:

By format I meant whether the LRECL of the file.

Unless your job changes the LRECL of the file, it will not change on its own. For a variable length file, the LRECL needs to be the length of the longest record plus 4 bytes for the RDW.

However, I suspect what you're wanting to know is whether or not a particular record length changed -- which is extremely different from asking if the LRECL is different (LRECL applies to the entire file, not a single record in the file). Again, ISPF 3.13 will tell you changed record lengths.

What are you using to copy the file -- program or utility? You say when you rewrite and try to copy you're getting an abend. Which abend -- what's the code? What messages are you getting? Can the rewrite change the record length? Are you doing the rewrite with a program or a utility?
Back to top
View user's profile Send private message
Paul1983

New User


Joined: 08 Jul 2008
Posts: 37
Location: bangy

PostPosted: Fri Oct 17, 2008 5:52 pm
Reply with quote

The maximum record length of my file is 1957.Please find the file details below

Volume serial: DEV929
File Type: KSDS
Device type: 3390
CI Size: 8192
Key length: 18
Key location: 8
Record format: V
Average record length: 1953
Maximum record length: 1957
Physical block size: 13682
Primary cylinders: 13
Secondary cylinders: 50


This file I'm rewriting through a COBOL program as below

SELECT FILE1 ASSIGN UT21
ORGANIZATION IS INDEXED
ACCESS IS SEQUENTIAL
RECORD KEY IS F1-KEY
FILE STATUS IS W120-FILE-STATUS.

FD FILE1.
01 FILE1-REC.
03 FILLER PIC X(8) VALUE SPACES.
03 F1-KEY PIC X(18).
03 FILLER PIC X(1931) VALUE SPACES.


READ FILE1.
MOVE FILE1-REC TO WS-F1-REC( where WS-F1-REC =X(1957))

REWRITE FILE1-REC FROM WS-F1-REC after editing the some records

The rewriting is going fine.
But after that when I'm trying to copy FILE1 using IDCAMS code its abending

//COPY1 EXEC PGM=IDCAMS
//SYSIN DD *
REPRO IFILE(F1PREV) OFILE(HEADER) COUNT(1)

//F1PREV DD DSN=XXXXX.XXX.XXX,
// DISP=SHR
//HEADER DD DSN=XXXX.XXX.XXXX,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(1957,(500,500),RLSE),AVGREC=U,
// DCB=(RECFM=VB,LRECL=1957,BLKSIZE=0)


This cloning is part of some project requiremnt

Thanks,
Paul


REPRO IFILE(F1PREV) OFILE(HEADER) COUNT(1)
IDC3302I ACTION ERROR ON XXXX.XXX.XXXX
IDC3309I ** RECORD X'002D000000' NOT WRITTEN. LENGTH INVALID
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Oct 17, 2008 5:57 pm
Reply with quote

The VSAM file record length is 1957. Your LRECL on a flat file must be 1961 to allow for the 4-byte Record Descriptor Word that is part of variable length files. The BLKSIZE must be at least 4 bytes greater than the LRECL to allow for the Block Descriptor Word. Your REPRO fails because you wrote a record of 1957 bytes, which cannot be placed in the HEADER file as it is too long (1953 is the longest record you can put in it).
Back to top
View user's profile Send private message
Paul1983

New User


Joined: 08 Jul 2008
Posts: 37
Location: bangy

PostPosted: Fri Oct 17, 2008 6:01 pm
Reply with quote

But when if I'm manually editing this FILE1 and trying to copy it, it's copying..That's why I got confused.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Oct 17, 2008 6:05 pm
Reply with quote

You probably have EDIT-SETTINGS set to not preserve trailing blanks in your ISPF edit. In which case you could edit the file, the trailing blanks on the record would be removed, and the file record could be saved in 1953 bytes (as long as there were at least 4 trailing blanks in the record)
Back to top
View user's profile Send private message
Paul1983

New User


Joined: 08 Jul 2008
Posts: 37
Location: bangy

PostPosted: Fri Oct 17, 2008 6:06 pm
Reply with quote

Can you please be much more detailed on the IDCAMS step as what should be the details I should give for the HEADER
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Oct 17, 2008 6:07 pm
Reply with quote

Code:
//HEADER DD DSN=XXXX.XXX.XXXX,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(1961,(500,500),RLSE),AVGREC=U,
// DCB=(RECFM=VB,LRECL=1961,BLKSIZE=0)
Back to top
View user's profile Send private message
Paul1983

New User


Joined: 08 Jul 2008
Posts: 37
Location: bangy

PostPosted: Fri Oct 17, 2008 7:07 pm
Reply with quote

But abending due to one more issue as down the line

//IEBCOMP1 EXEC PGM=IEBCOMPR
//SYSIN DD *
COMPARE TYPORG=PS
//SYSUT1 DD DSN=XXXXX.XXXXXX.XXXXX.XXXXXX1,
// DISP=SHR
//SYSUT2 DD DSN=XXXXX.XXXXXX.XXXXX.XXXXXX2,
// DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=X,HOLD=YES
// ENDIF

where
XXXXX.XXXXXX.XXXXX.XXXXXX1 and XXXXX.XXXXXX.XXXXX.XXXXXX2
are having same file attributes

the abend is as follows

COMPARE TYPORG=PS
IEB255I CORRESPONDING RECORD LENGTHS ARE NOT EQUAL

DDNAME = SYSUT1
PHYSICAL RECORD NUMBER = 00000001 LOGICAL RECORD NUMBER WITHIN PHYSICAL RECORD = 00000001

DDNAME = SYSUT2
PHYSICAL RECORD NUMBER = 00000001 LOGICAL RECORD NUMBER WITHIN PHYSICAL RECORD = 00000001


Thanks,
Paul
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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 Populate last day of the Month in MMD... SYNCSORT 2
Search our Forums:

Back to Top