View previous topic :: View next topic
|
Author |
Message |
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
I understand that records having variable lenght format use the first 4 bytes to store the length. So record length = actual data length + 4 bytes. But I can never see the first 4 bytes in any view mode.Why is this? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The first 4 bytes of a VB record (RDW) is hidden by many products. The length of the record is actually in the first two bytes of the 4-byte RDW.
You can use a DFSORT job like the following to see the RDW (in hex) and the rest of the record in EBCDIC (OUT1) and the length (in decimal) and the rest of the record in EBCDIC (OUT2):
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB)
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,OUTREC=(1,4,1,4,HEX,C'|',5)
OUTFIL FNAMES=OUT2,OUTREC=(1,4,1,2,BI,C'|',5)
/*
|
An example of the output in OUT1 would be:
Code: |
00540000|$CBXA FIRST II072F 1+12341
002F0000|$AXX SECOND BB002F 2+67214FLKDJFLJASDFJASD
001F0000|$BBXB THIRD GG002D 2+00005
|
An example of the output in OUT2 would be:
Code: |
84 |$CBXA FIRST II072F 1+12341
47 |$AXX SECOND BB002F 2+67214FLKDJFLJASDFJASD
31 |$BBXB THIRD GG002D 2+00005
|
|
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
Thanx a lot Frank .. that was good!!
The other problem that I have is ...when I take a VB file (oh no not again),and zip it in text mode wtihout any delimiters, what happens to the 4 byte RDW in front of each line????
What should I see when I upzip the file in an ASCII viewer?? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
You can only keep the VB dataset's RDW values when you zip the file with both the -DATA_TYPE(BINARY) and -SAVE_LRECL(Y) options specified. |
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
Thanx... But using Binary zipping would mean that I can no longer FTP the zip file to my PC and browse it using a normal ASCII viewer,right? |
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
Also . we are using PKZIP to do the zipping. I cud not locate the SAVE_LRECL parameter for this software. However, there seems to be a -ZDW option which can maintain the record lengths in binary mode. Will this work with a VB file? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
To answer your first question, yes, you will not be able to view the file contents in ASCII.
For your second question, this is from the manual:
Quote: |
-SAVE_LRECL
Synonyms Include: -RDW, -USE_SAVED_LRECL, -ZDW
This command is used in combination with -DATA_TYPE(BINARY) during ZIP processing to specify record lengths should be retained with the ZIPPED file. This is particularly useful for files containing variable-length records that need to be restored to their original length during UnZip processing.
-SAVE_LRECL(Y|N)
Y-Yes Specifies that record length information is to be included in the ZIP archive.
N-No Specifies that record length information is not to be included.
It is highly recommended that VSAM files ZIPPED as BINARY should have
-SAVE_LRECL(Y) specified.
-SAVE_LRECL(Y) should always be specified with load modules.
This command does NOT apply to files ZIPPED as TEXT.
|
|
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
Thanx a lot for your inputs guys!!!!This has been very helpful!! |
|
Back to top |
|
|
|