Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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

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..





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

Back to top
View user's profile Send private message

Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

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

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.

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           

 BROWSE    DESXXX.MAINFR.SALIDA1                      Line 00000000 Col 001 080
 Command ===>                                                  Scroll ===> CSR
********************************* Top of Data *********************************
******************************** Bottom of Data *******************************

Best regards

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 Required Date Format in Include Sort ... vivky_vivek DFSORT/ICETOOL 6 Fri Aug 14, 2020 6:52 am
No new posts Trying to add current date in place o... shub2204 DFSORT/ICETOOL 8 Wed Aug 12, 2020 4:14 pm
No new posts Am Getting a vertical line in ISPF SC... Himansu22 TSO/ISPF 3 Fri Jul 31, 2020 11:58 pm
No new posts Populating Date and Sequence numer in... PORYES SYNCSORT 11 Thu Jul 16, 2020 5:01 pm
No new posts How to filter out certain records bas... manugeorge2004 JCL & VSAM 5 Wed Jun 17, 2020 10:05 pm

Back to Top
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us