View previous topic :: View next topic
Author
Message
sreejeshcs New User Joined: 28 May 2007Posts: 31 Location: Pune
Could you help me to solve the below scenario?
A Variable Block file having several Rec type ( Rec type 00,10,11,12... )
75th Position on the Rec type 10 having a date field in the format 20071231, I need to change all the date in the same field to 20091231.
I/P may contain multile Rec 10.
How can I do this using ICEMAN
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
It's not clear what you want to do.
What is the starting position of the record type (remember to count the RDW in positions 1-4)?
What is the starting position of the date you want to change (remember to count the RDW in positions 1-4)?
Do you want to change the date to '20091231' in every type 10 record, or only in type 10 records that currently have '20071231' for the date?
Back to top
sreejeshcs New User Joined: 28 May 2007Posts: 31 Location: Pune
Code:
//TEST01 PROC
// SOUT=J
//STEP010 EXEC PGM=FILEAID
//*INPUT FILE
//DD01 DD DSN=PREFIX.BP860.STREAM.GENERIC,DISP=SHR
//*OUTPUT FILE
//DD01O DD DSNPREFIX.BP860.STREAM.GENERIC,DISP=OLD
//* UNIT=&UNIT,
//* DCB=(RECFM=VB,LRECL=148,DSORG=PS),
//* SPACE=(CYL,(1,30),RLSE)
//SYSIN DD DSN=&PREFIX1..PARMS(TEST02),DISP=SHR
//SYSOUT DD SYSOUT=&SOUT
//SYSABEND DD SYSOUT=&SOUT
//SYSABOUT DD SYSOUT=&SOUT
****************************
PARM : TEST02
****************************
££DD01 USER RDW=3,MOVE=(1,0,1),
IF=(1,NE,C'10'),WRITE=DD01O,
IF=(1,EQ,C'10'),
MOVE=(75,C'20090401'),WRITE=DD01O
****************************
I need to replace the FileAid utility with ICEMAN.
Rec type 10 is starting from Position 1. and the date will populate from position 75.
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
Sreejesh
Here are the equivalent control cards for sort
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=PREFIX.BP860.STREAM.GENERIC,DISP=SHR
//SORTOUT DD DSN=your output file,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
INREC IFTHEN=(WHEN=(5,2,CH,EQ,C'10'),OVERLAY=(79:C'20090401'))
SORT FIELDS=COPY
/*
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Sreejesh ,
I don't know FileAid, but I can guess from what you posted that the answers to my questions are as follows:
Quote:
What is the starting position of the record type (remember to count the RDW in positions 1-4)?
5
Quote:
What is the starting position of the date you want to change (remember to count the RDW in positions 1-4)?
79
Quote:
Do you want to change the date to '20091231' in every type 10 record, or only in type 10 records that currently have '20071231' for the date?
In every type 10 record.
In which case, you can use this DFSORT job:
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=PREFIX.BP860.STREAM.GENERIC,DISP=SHR
//SORTOUT DD DSNPREFIX.BP860.STREAM.GENERIC,DISP=OLD
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(5,2,CH,EQ,C'10'),OVERLAY=(79:C'20090401'))
/*
Back to top
Please enable JavaScript!