View previous topic :: View next topic |
Author |
Message |
mainhead Beginner
Joined: 07 Feb 2006 Posts: 26 Topics: 11
|
Posted: Tue Jul 25, 2006 1:20 pm Post subject: File Edit Problem |
|
|
Hi ,
I want to edit the reocrd which was in Tape file , i want to edit few fields which need to be changed as per condition below
Below is intial idea to convert the file
1 >> File was in Tape
2>> Repro to Flat file (ie Since the file size was large iam unable to open in edit mode)
3 >> Now my record layout looks as below
Code: |
LVL FIELD NAME FORMAT POS DATA
01 GRRN1-SSPOGS-RNGE-REC G 1
03 GRRN1-RETAIL-OUTLET-NO P 5 1 2001
03 GRRN1-BASE-PRODUCT-NO P 9 4 50000348
03 GRRN1-RANGE-EFFV-DATE C 8 9 20060410
03 GRRN1-RANGE-EFFV-END-DATE C 8 17 20060714
03 GRRN1-SYSTEM-SOURCE C 1 25 S
03 GRRN1-ORDER-GROUP C 2 26
03 GRRN1-MERCH-GRP-CODE C 3 28 S3O
03 GRRN1-RNGNG-SALES-PRD Z 2 31 02
03 GRRN1-RNGNG-SALES-WKS Z 2 33 01
03 GRRN1-RNGNG-SALES-VAL PS 72 35 +3.42
03 GRRN1-RNGNG-SALES-QTY PS 83 40 +1.000
03 GRRN1-PREDICTION-DAYS Z 2 46 21
03 GRRN1-ESTIM-GROUP G 48
05 GRRN1-ESTIM-SALES(1) PS 5 48 +0
|
The above file layout has any combinations , My requirement is of below
1 >> I want to edit the field of GRRN1-RANGE-EFFV-END-DATE if the record show was 20060714 to 99991231 for only GRRN1-MERCH-GRP-CODE = "N2A" (wheareas currently show has S3O.
Please let me know how i can solve this by Jcl or Easytrieve Program .
Your reply is highly appreciated .
Thanks |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Tue Jul 25, 2006 1:34 pm Post subject: |
|
|
Mainhead,
Don't open more than 1 topic for the same question. I deleted your duplicated post in the application programming forum. The layout you posted is unknown to me. Please post the COBOL layout.
And your requirement is
Code: |
IF GRRN1-MERCH-GRP-CODE = "N2A" AND
GRRN1-RANGE-EFFV-END-DATE = 20060714
THEN
MOVE 99991231 TO GRRN1-RANGE-EFFV-END-DATE
END-IF
|
is that it ?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
mainhead Beginner
Joined: 07 Feb 2006 Posts: 26 Topics: 11
|
Posted: Tue Jul 25, 2006 2:21 pm Post subject: |
|
|
Iam Sorry
Here is the layout
Code: |
01 GRRN1-SSPOGS-RNGE-REC.
03 GRRN1-RETAIL-OUTLET-NO PIC 9(5) COMP-3.
03 GRRN1-BASE-PRODUCT-NO PIC 9(9) COMP-3.
03 GRRN1-RANGE-EFFV-DATE PIC X(8).
03 GRRN1-RANGE-EFFV-END-DATE PIC X(8).
03 GRRN1-SYSTEM-SOURCE PIC X.
03 GRRN1-ORDER-GROUP PIC XX.
03 GRRN1-MERCH-GRP-CODE PIC XXX.
03 GRRN1-RNGNG-SALES-PRD PIC 99.
03 GRRN1-RNGNG-SALES-WKS PIC 99.
03 GRRN1-RNGNG-SALES-VAL PIC S9(7)V99 COMP-3.
03 GRRN1-RNGNG-SALES-QTY PIC S9(8)V9(3) COMP-3.
03 GRRN1-PREDICTION-DAYS PIC 99.
03 GRRN1-ESTIM-GROUP.
|
|
|
Back to top |
|
 |
mainhead Beginner
Joined: 07 Feb 2006 Posts: 26 Topics: 11
|
Posted: Tue Jul 25, 2006 2:51 pm Post subject: |
|
|
I forgot to add this , in the output record i need to get the changed record (99991231) and the non matching condtion exits in input file also need to be in output file
Thanks |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Tue Jul 25, 2006 2:56 pm Post subject: |
|
|
mainhead,
Since you did not confirm the conditions , I am going with my assumption. Try this DFSORT job.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your input tape file,
// DISP=SHR
//SORTOUT DD DSN=YOUT OUTPUT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(28,3,CH,EQ,C'N2A',AND,
17,8,CH,EQ,C'20060714'),
OVERLAY=(17:C'99991231'))
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
mainhead Beginner
Joined: 07 Feb 2006 Posts: 26 Topics: 11
|
Posted: Tue Jul 25, 2006 11:21 pm Post subject: |
|
|
kOLUSU ,
ITs worked , Thanks a lot |
|
Back to top |
|
 |
|
|