Copying a VB record when certain conditions are met

Ask/Clarify the questions on EASYTRIEVE

Moderators: DikDude, Moderator Group

Sturminator
Member
Posts: 10
Joined: Fri May 25, 2012 4:52 pm

Post by Sturminator » Tue May 29, 2012 10:59 pm

Changed lrecl and removed blksize in code:

FILE FILEA
FA-ARG 01 06 N

FILE FILEB VB 1035
IN-REC 01 1035 A
REC-TYP 71 1 A
FB-ARG 325 06 N

FILE MTCHOUT VB 1035
OUT-REC 01 1035 A

JOB INPUT (FILEA KEY(FA-ARG) +
FILEB KEY(FB-ARG))

IF MATCHED AND REC-TYP = 'L'
OUT-REC = IN-REC
PUT MTCHOUT
END-IF






Received abend messages:

3 FILE FILEB VB 1035
3 *******B026 REQUIRED PARAMETER IS NOT CODED
4 IN-REC 01 1035 A
5 REC-TYP 71 1 A
6 FB-ARG 325 06 N

7 FILE MTCHOUT VB 1035
7 *******B026 REQUIRED PARAMETER IS NOT CODED
8 OUT-REC 01 1035 A

9 JOB INPUT (FILEA KEY(FA-ARG) +

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Tue May 29, 2012 11:14 pm

// DCB=(SYS2.DSCB,RECFM=VB,LRECL=1039,BLKSIZE=27998)


FILE FILEB VB (1035 1039)

don't know anything about ezytrieve,
but, the lrecl in the dcb should include VLI (RDW) yes?no?
but normally, the vli(rdw) is not included in the file description size. yes/no???

but when you define only 1 size for the file length,
then it is no longer VB
FILE FILEB VB 1035 <<<<<<<<<<<<missing arg....
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Tue May 29, 2012 11:17 pm

My intent was to change the JCL, not the program. . .

Please try again.

The earlier post has been edited for clarification.
Last edited by DikDude on Wed May 30, 2012 1:36 am, edited 1 time in total.
Have a good one

Sturminator
Member
Posts: 10
Joined: Fri May 25, 2012 4:52 pm

Post by Sturminator » Tue May 29, 2012 11:41 pm

Changed JCL to lrecl 1035 and removed blksize on the output file MTCHOUT:

// DCB=(SYS2.DSCB,RECFM=VB,LRECL=1035)


Results are the same as above where the last 4 bytes of the records are gone.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed May 30, 2012 1:41 am

Please go to 3.4 and look at the file information for both files and post the result here (if they are not the same). If they are the same, just show one.

Also, suggest you take the blksize out of the SPACE parameter. And while editing, try without the SYS2.DSCB. It shouldn't hurt, but none of my clients has used model dscbs for a long time.

If i can, i'll try to test this sometime this evening (no guarantee).
Have a good one

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed May 30, 2012 2:21 am

Your records in the JCL you show are 1039. Your records in your program are 1035. Difference is four bytes.

For the FILE you should be able to code VB ( 1039 0 ) and Easytrieve will handle (in co-operation with SMS, or the JCL) obtaining the blocksize at run-time.

I see you now changed the records on the file to max of 1035, so your four bytes won't fit any more anyway.

What is the LRECL of the file containing the data you want to copy? Have the same LRECL for your output.

Put that on the FILE statements of the Easytrieve program. Put zero for the blocksizes. Enclose the two in brackets/parenthesis.

PUT A FROM B

or

MOVE A TO B
PUT B

Get rid of the assignment statement. When you get records shorter than the maximum, you are putting rubbish into your output, and at some point you'll get an S0C4 as you attempt to access data beyond the final short record in the last input buffer.

Sturminator
Member
Posts: 10
Joined: Fri May 25, 2012 4:52 pm

Post by Sturminator » Wed May 30, 2012 5:21 pm

Success !!! In the code, changing to VB ( 1039 0 ) and getting rid of the assignment statement was the solution. No JCL changes were needed. Here is the code:


FILE FILEA
FA-ARG 01 06 N

FILE FILEB VB (1039 0)
REC-TYP 71 1 A
FB-ARG 325 06 N

FILE MTCHOUT VB (1039 0)

JOB INPUT (FILEA KEY(FA-ARG) +
FILEB KEY(FB-ARG))

IF MATCHED AND REC-TYP = 'L'
PUT MTCHOUT FROM FILEB
END-IF




THANKS !!!!

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Thu May 31, 2012 12:03 am

Good to hear it is working - thank you for letting us know :)

d
Have a good one

academyindia4

Topic deleted by Admin

Post by academyindia4 » Tue Jan 19, 2016 8:16 pm

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others