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

Copying a VB record when certain conditions are met

Post by Sturminator » Fri May 25, 2012 5:01 pm

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

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Fri May 25, 2012 5:49 pm

What makes you think that the RDW is NOT being processed considering that it does not show up in file displays in ISPF edit or browse?
Regards
Nic

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

Post by Sturminator » Fri May 25, 2012 5:54 pm

Yes. When I look at the input file all the way to the right it has 4 more columns ("Col") than the output record. Also, subsequent processing is not working I believe due to the data being 4 positions off.

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sun May 27, 2012 10:59 am

Have you tried using your sort product to do the select/copy?
Regards
Nic

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

Post by DikDude » Mon May 28, 2012 6:54 am

Hello,

When you write the "new" output record, the write will automatically insert the RDW before the application data. You should NOT try to manipulate the RDW.
Have a good one

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

Post by William Collins » Mon May 28, 2012 11:25 pm

Did you look at PUT xx FROM?

Or MOVE filename?

Or RECORD-LENGTH ?

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

Post by Sturminator » Tue May 29, 2012 4:46 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 ?

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Tue May 29, 2012 5:13 pm

file aid will know that it is a VB file and should do all the necessary stuff behind the scenes. You should be able to just concentrate on the data
Regards
Nic

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

Post by Sturminator » Tue May 29, 2012 5:16 pm

That is what I thought but it is not working. I must not be specifying something correctly in the statements. I have tried saying the record is 1035 in length and 1039 in length and neither works for me.

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

Post by Sturminator » Tue May 29, 2012 6:15 pm

Please note that it is the last 4 bytes that are missing; not the 1st 4 (RDW) like I originally thought. So it is some of the data that I am missing.

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

Post by William Collins » Tue May 29, 2012 6:21 pm

Look, this is not FILEAID. It is Easytrieve Plus. Did you look at my previous reply?

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

Post by Sturminator » Tue May 29, 2012 6:36 pm

I did look at your previous reply and tried some of it and it didn't work. I am sorry that I am in the File Aid section here when (you are right) it is Easytrieve. My mistake. I will cease and desist with this and go to the Easytrieve postings.

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

Post by DikDude » Tue May 29, 2012 9:15 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.
Have a good one

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

Post by Sturminator » Tue May 29, 2012 10:41 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.

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

Post by DikDude » Tue May 29, 2012 10:51 pm

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.
Last edited by DikDude on Tue May 29, 2012 11:18 pm, edited 1 time in total.
Have a good one

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