Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How do I define my fields for Variable Blocked File in easyt

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: How do I define my fields for Variable Blocked File in easyt
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

Site Director


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

PostPosted: Sat May 19, 2007 2:27 am    Post subject:
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    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 9:35 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 9:39 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 10:09 pm    Post subject: Re: How do I define my fields for Variable Blocked File in e
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Jun 07, 2007 3:50 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us