Copying a VB record when certain conditions are met
Moderators: DikDude, Moderator Group
-
- Member
- Posts: 10
- Joined: Fri May 25, 2012 4:52 pm
Copying a VB record when certain conditions are met
I am trying to copy an entire VB record when certain conditions are met. It seems that I am only copy the data portion and not the 1st 4 bytes of the VB record. I am missing a small detail probably. Statements below: FILE FILEA
FA-ARG 01 06 N
FILE FILEB VB (1035 1039)
IN-REC 01 1035 A
REC-TYP 71 1 A
FB-ARG 325 06 N
FILE MTCHOUT VB (1035 1039)
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
FA-ARG 01 06 N
FILE FILEB VB (1035 1039)
IN-REC 01 1035 A
REC-TYP 71 1 A
FB-ARG 325 06 N
FILE MTCHOUT VB (1035 1039)
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
-
- Member
- Posts: 10
- Joined: Fri May 25, 2012 4:52 pm
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 10
- Joined: Fri May 25, 2012 4:52 pm
I have not tried the SORT program since it looked more complicated. With File Aid I am trying to read 1 file (FILE A) which has only 1 record and use the 1st 6 bytes to select records from FILE B. This part is working. My only problem is when the selected records are copied from the FILE B to the FILE MTCHOUT, output file FILE MTCHOUT drops the last 4 bytes of the file. I am not familiar with using variable block files in File Aid. My LRECL is 1039 and the 1st 4 are the RDW. So how do I specify that in File Aid and write the entire 1039 to the output file ?
-
- Member
- Posts: 10
- Joined: Fri May 25, 2012 4:52 pm
-
- Member
- Posts: 10
- Joined: Fri May 25, 2012 4:52 pm
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 10
- Joined: Fri May 25, 2012 4:52 pm
You need to STOP posting "it didn't work" as this is totally useless for getting help . . .
When something does not work, you need to post the statement(s) used, the jcl, and the diagnostic info from the run (only the parts that are relevant). If the data created is not what you expect, show the data (in hex) for a record or 2. If the records are quite long, only post the parts that demonstrate the problem.
Originally a bit of code was posted, but as experiments were tried, the output from these (and the modified code) is needed for us to help.
Your duplicate post has been removed - this topic and all of the dialog are now in the Easytrieve part of the forum.
When something does not work, you need to post the statement(s) used, the jcl, and the diagnostic info from the run (only the parts that are relevant). If the data created is not what you expect, show the data (in hex) for a record or 2. If the records are quite long, only post the parts that demonstrate the problem.
Originally a bit of code was posted, but as experiments were tried, the output from these (and the modified code) is needed for us to help.
Your duplicate post has been removed - this topic and all of the dialog are now in the Easytrieve part of the forum.
Have a good one
-
- Member
- Posts: 10
- Joined: Fri May 25, 2012 4:52 pm
JCL:
//FILEA DD DSN=&PREFDATE.URS.TRF016.IMAGE.DATECARD(0),DISP=SHR
//FILEB DD DSN=&PREFIN.URS.V600.TRF250.&INPUT(0),DISP=SHR
//*
//MTCHOUT DD DSN=&&CURBKDT,
// DISP=(,PASS),
// UNIT=SYSDA,
// SPACE=(27998,(1800,180),RLSE),
// DCB=(SYS2.DSCB,RECFM=VB,LRECL=1039,BLKSIZE=27998)
Easytrieve code:
FILE FILEA
FA-ARG 01 06 N
FILE FILEB VB (1035 1039)
IN-REC 01 1035 A
REC-TYP 71 1 A
FB-ARG 325 06 N
FILE MTCHOUT VB (1035 1039)
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
End of 3 of the expected output records (actually input records since I expect an copy) in hex:
Line 00000000 Col 00956
Scroll ===> CSR
********************************
-------------------------------
................................
00000000000000000000000000000000
0000000C0000000C0000000C0000000C
-------------------------------
................................
00000000000000000000000000000000
0000000C0000000C0000000C0000000C
-------------------------------
................................
00000000000000000000000000000000
0000000C0000000C0000000C0000000C
-------------------------------
End of 3 of the received records in hex:
Line 00000000 Col 00952
Scroll ===> CSR
**********************************
-----------------------------------
....................................
000000000000000000000000000000000000
0000000C0000000C0000000C0000000C0000
-----------------------------------
....................................
000000000000000000000000000000000000
0000000C0000000C0000000C0000000C0000
-----------------------------------
....................................
000000000000000000000000000000000000
0000000C0000000C0000000C0000000C0000
-----------------------------------
Fields shown in hex and are packed decimal. The last field in each received record is missing its 2nd half.
//FILEA DD DSN=&PREFDATE.URS.TRF016.IMAGE.DATECARD(0),DISP=SHR
//FILEB DD DSN=&PREFIN.URS.V600.TRF250.&INPUT(0),DISP=SHR
//*
//MTCHOUT DD DSN=&&CURBKDT,
// DISP=(,PASS),
// UNIT=SYSDA,
// SPACE=(27998,(1800,180),RLSE),
// DCB=(SYS2.DSCB,RECFM=VB,LRECL=1039,BLKSIZE=27998)
Easytrieve code:
FILE FILEA
FA-ARG 01 06 N
FILE FILEB VB (1035 1039)
IN-REC 01 1035 A
REC-TYP 71 1 A
FB-ARG 325 06 N
FILE MTCHOUT VB (1035 1039)
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
End of 3 of the expected output records (actually input records since I expect an copy) in hex:
Line 00000000 Col 00956
Scroll ===> CSR
********************************
-------------------------------
................................
00000000000000000000000000000000
0000000C0000000C0000000C0000000C
-------------------------------
................................
00000000000000000000000000000000
0000000C0000000C0000000C0000000C
-------------------------------
................................
00000000000000000000000000000000
0000000C0000000C0000000C0000000C
-------------------------------
End of 3 of the received records in hex:
Line 00000000 Col 00952
Scroll ===> CSR
**********************************
-----------------------------------
....................................
000000000000000000000000000000000000
0000000C0000000C0000000C0000000C0000
-----------------------------------
....................................
000000000000000000000000000000000000
0000000C0000000C0000000C0000000C0000
-----------------------------------
....................................
000000000000000000000000000000000000
0000000C0000000C0000000C0000000C0000
-----------------------------------
Fields shown in hex and are packed decimal. The last field in each received record is missing its 2nd half.
Suggest you change the lrecl to 1035 and remove the blksize (in the JCL, not the code). Let us know what happens.
Edited for clarification.
Edited for clarification.
Last edited by DikDude on Tue May 29, 2012 11:18 pm, edited 1 time in total.
Have a good one
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page