Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Replace a DATE in Line-2/ Column 160 to 167 in VB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
nareshkareti

New User


Joined: 22 Jul 2008
Posts: 33
Location: Chennai

PostPosted: Mon Mar 30, 2015 2:01 pm    Post subject: Replace a DATE in Line-2/ Column 160 to 167 in VB
Reply with quote

I have a VB file and I need to replace a DATE string in the 2nd line at 160 to 167 positions.
The DATE in this position will always change and I just need to replace the this date from the date in another file..

File-1
Code:

header1234
abcdefgh10102014qwerty
trailer1234


File-2
Code:

05052015


the date in file-1 in line-2 .. position 9 (10102014) has to be replaced by 05052015.
This is just example, but ideally the date in file-1 will not be known and i just have to replace position 9-16 with 05052015 only in line-2. This date change should happen only in Line-2 in my requirement.

Pleas help with a SORT step to achieve this

Thanks
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Mar 30, 2015 2:54 pm    Post subject: Reply to: Replace a DATE in Line-2/ Column 160 to 167 in VB
Reply with quote

Two-step process.

First, you take your date file and generate a sort symbol/SYMNAME from it. Be aware that the file where you generate the symbol must have fixed-length 80-byte records, so end your BUILD with 80:X) is a good way to do that.

Second, extend your variable-length records, after the RDW, to include enough space for a sequence number which is big enough for the number of records your file can contain. Put a sequence number there. When the sequence number is two, do an OVERLAY to put the date symbol in the position you requiure.

Ensure that your records are then restored to their original size without the extension.
Back to top
View user's profile Send private message
rinsio

New User


Joined: 16 Feb 2015
Posts: 13
Location: Madrid, Spain

PostPosted: Mon Mar 30, 2015 3:51 pm    Post subject:
Reply with quote

Hello nareshkareti
There is another option but you shuld give us more detalis. For example

is the detail record identified? I think a solution thinking about the types of record have identifications. I simulate FB file. You could make the changes you need.

Code:
000015 //PASO001 EXEC PGM=SORT,COND=(0,NE)                             
000016 //SYSOUT   DD SYSOUT=*                                           
000017 //SORTIN   DD *                                                 
000018 05052014                                                         
000019 /*                                                               
000020 //SORTOUT  DD DSN=DESXXX.MAINFR.SALIDA,                         
000021 //            DISP=(,CATLG,DELETE),                             
000022 //            SPACE=(TRK,(10,10),RLSE),                         
000023 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)         
000024 //SYSIN   DD *                                                   
000025   SORT FIELDS=COPY                                               
000026   OUTREC FIELDS=(3X,C'OVERLAY=(9:C',X'7D',1,08,X'7D',           
000027                  C'))',53X)                                     
000028 /*                                                               
000029 //***********                                                   
000030 //PASO002 EXEC PGM=SORT,COND=(0,NE)                             
000031 //SYSOUT   DD SYSOUT=*                                           
000032 //SORTIN   DD *                                                 
000033 HEADER1234                                                     
000034 ABCDEFGH10102014QUERTY                                         
000035 TRAILER1234                                                   
000036 /*                                                             
000037 //SORTOUT  DD DSN=DESXXX.MAINFR.SALIDA1,                       
000038 //            DISP=(,CATLG,DELETE),                           
000039 //            SPACE=(TRK,(10,10),RLSE),                       
000040 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)       
000041 //SYSIN    DD *                                               
000042     SORT  FIELDS=COPY                                         
000043   OUTFIL FNAMES=SORTOUT,                                       
000044     IFTHEN=(WHEN=(01,1,CH,EQ,C'A'),                           
000045 //         DD DSN=DESRIB.MAINFR.SALIDA,DISP=SHR           


Code:
OUTPUT FILE
 BROWSE    DESXXX.MAINFR.SALIDA1                      Line 00000000 Col 001 080
 Command ===>                                                  Scroll ===> CSR
********************************* Top of Data *********************************
HEADER1234                                                                     
ABCDEFGH05052014QUERTY                                                         
TRAILER1234                                                                   
******************************** Bottom of Data *******************************


Best regards

Code'd
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us