IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to change date in VB file.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sreejeshcs

New User


Joined: 28 May 2007
Posts: 31
Location: Pune

PostPosted: Wed Mar 11, 2009 8:00 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Mar 11, 2009 9:19 pm
Reply with quote

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
View user's profile Send private message
sreejeshcs

New User


Joined: 28 May 2007
Posts: 31
Location: Pune

PostPosted: Thu Mar 12, 2009 12:24 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Mar 12, 2009 9:03 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 12, 2009 9:05 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top