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

How do I define my fields for Variable Blocked File in easyt


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Sat May 19, 2007 12:59 am
Reply with quote

How do I define my fields for Variable Blocked File in easytieve?
I need to read a VBM 255 input file.
Code:
FILE INFILE VB(259 13686) 
IN-REC      1 255 A VARYING
IN-CC       1  01 A       
IN-LABEL    2  09 A       
IN-DATA    19  35 A       

I get S0C7 with this varying, without it I get S0C4 for records where the IN-DATA is less than 35 char.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat May 19, 2007 2:27 am
Reply with quote

Hello,

If your file is actually variable blocked, i believe you must allow for the block and record descriptor words. Your file definition does not do that. Each is 4 bytes long. These definitions should be placed before the IN-REC definition.

The displacements of the other fields needs to be changed to reflect the 2 new fields.

As you have defined no numeric fields, i'm not sure how you get a s0c7 icon_confused.gif

You might check the record descriptor word and note the length of the record being processed. The s0c4 may be because you are referencing memory that is not part of the record (which would be the case for the "short" records).
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Mon May 21, 2007 10:21 pm
Reply with quote

It does not seem like I need to define the block and record descriptor words, I think that the system is removing them before it gives me the data. When I define the record as follows, the fields "in-label" and "in-data" contain what I expect and INFILE:RECORD-LENGTH contains the record length.
Code:
FILE INFILE VB(259 13686)   
*IN-REC      1 255 A VARYING
IN-REC      1 255 A         
IN-CC       1  01 A         
IN-LABEL    2  09 A         
IN-DATA    19  35 A         

The problem is when the record length is between 19 and 54 when I move in-data this goes past the end of the record and may S0C4. How do I define these fields so that I can move just the part of the infile that does exist for this record to another field?
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Mon Jun 04, 2007 9:14 pm
Reply with quote

Does anyone have any idea how a can move a variable number of characters from one fields to another? I have not found how to do dynamic reference modification in easytrieve.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 9:35 pm
Reply with quote

Douglas Wilder wrote:
The problem is when the record length is between 19 and 54 when I move in-data this goes past the end of the record and may S0C4. How do I define these fields so that I can move just the part of the infile that does exist for this record to another field?
Why are you moving data to the input record?
Of course it will abend, that is effectively the I/O buffer.
If you want to add to the length, do so in the output area or working storage.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 9:39 pm
Reply with quote

Douglas Wilder wrote:
Does anyone have any idea how a can move a variable number of characters from one fields to another? I have not found how to do dynamic reference modification in easytrieve.
EZT Referencer Guide, Data Definition, Define Statement Examples, Varying Length Fields.....
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Mon Jun 04, 2007 9:57 pm
Reply with quote

I am moving these fields from the input to the output (or I could move them to working storage fields first). The output field is fixed length. The manual I have is very old but it seems to indicate the the length of variable length fields are the first 2 bytes of the field. The length of the variable length record is 4 bytes in record-length and the fields in the input record are not prefixed with a 2 byte record length. Is there a way to use a different (working storage field) for the length of a variable length field in the input record?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 10:09 pm
Reply with quote

[quote="Douglas Wilder"]
Code:
FILE INFILE VB(259 13686) 
IN-REC      1 255 A VARYING
IN-CC       1  01 A       
IN-LABEL    2  09 A       
IN-DATA    19  35 A       
IIRC (I'll try to check in a bit), IN-DATA would have to be defined VARYING also, its length depending upon either IN-LABEL's need or computed from the record length. Once decieded upon, move that length to the length attribute for IN-DATA.
Fairly current manuals are here.
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Thu Jun 07, 2007 3:41 am
Reply with quote

I found a working solution I thought might help others working with variable length records. Note that in this case nothing in the record indicates how long the record might be. It uses the MOVE statement with the length to move from and to and the fill character.
Code:
FILE INFILE VB(259 0)                                 
IN-REC      1 255 A                                   
                                                       
FILE OUTFILE                                           
OUT-REC     1 141 A                                   
OUT-RECIP   1   9 A                                   
OUT-NAME   10  35 A                                   
OUT-TITLE  45  35 A                                   
OUT-ADDR   70  35 A                                   
                                                       
WS-REC      W           255 A                         
WS-CC       WS-REC        1 A                         
WS-LABEL    WS-REC  +01  09 A                         
WS-DATA     WS-REC  +18  35 A                         
                                                       
JOB INPUT INFILE FINISH WRAP-UP                       
                                                       
MOVE IN-REC INFILE:RECORD-LENGTH TO WS-REC 255 FILL ' '
                                                       
IF WS-LABEL = 'RECIPIENT'               
    MOVE WS-DATA TO OUT-RECIP           
ELSE                                   
    IF WS-LABEL = 'NAME     '           
        MOVE WS-DATA TO OUT-NAME       
    ELSE                               
        IF WS-LABEL = 'TITLE    '       
            MOVE WS-DATA TO OUT-TITLE   
        ELSE                           
            IF WS-LABEL = 'ADDRESS  '   
                MOVE WS-DATA TO OUT-ADDR
                PUT OUTFILE             
            END-IF                     
        END-IF                         
    END-IF                             
END-IF                                 
                                                                                                   
WRAP-UP. PROC                                               
    DISPLAY '**********************************************'
    DISPLAY '************ PROGRAM EZ REPORT RECIPIANTS ****'
    DISPLAY '**********************************************'
    DISPLAY '* RECORDS READ    = ' INFILE:RECORD-COUNT     
    DISPLAY '* RECORDS WRITTEN = ' OUTFILE:RECORD-COUNT     
    DISPLAY '**********************************************'
END-PROC                                                   


I tried a lot of ways that got S0C7 or S0C4 but this way worked.

Thank You
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jun 07, 2007 3:50 am
Reply with quote

Very good of you to post a solution, Thank you.....
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 -> CA Products

 


Similar Topics
Topic Forum Replies
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 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