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

Propagate information from HDR1 in variable length records


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

New User


Joined: 16 Dec 2003
Posts: 5

PostPosted: Thu May 06, 2010 12:05 am
Reply with quote

Hi Frank/skolusu

I need to propagate information from HDR1(Q00660 CPMFSER) in the fix part of each variables length records of a file(col 41). I think SPLICE could do the trick but with variable length records i don't how.

HDR1 is already in a separate file.
Code:
VOL1Q006600                              VSSI VTAPE
HDR1RTM.TAPE         Q00660000100010027000101110101250000000BSS BSS P       0000
HDR2V327603275640PARS    /RES     P   B


In the same time can i drop the 16 last bytes of each variables records which contains garbage.

varlenrecords:
Code:
ISREDDE2   SCOT.AR.RTM.Q00660.RED                Columns 00001 00072
Command ===>                                        Scroll ===> CSR 
****** ***************************** Top of Data ********************   
000001 <RESARAIL-XML><SBO>M80110000000007010060            </SBO><D1></RESARAIL-XML>BSS SN  EüeM¬< a                            <end of record>
000002 <RESARAIL-XML><SBO>M80110000000007010060            </SBO><D1></RESARAIL-XML>BSS SN  EüeM¬&­a                            <end of record>
000003 <RESARAIL-XML><SBO>M80110000000007010060            </SBO><D1></RESARAIL-XML>BSS SN  EüeM¬è¸                             <end of record>
000004 <RESARAIL-XML><SBO>M80110000000007010061            </SBO><D1></RESARAIL-XML>BSS SN  EüeM¯XÜ                             <end of record>
000005 <RESARAIL-XML><SBO>A0011001A0A8809323254            </SBO><I1>>AU BOIS DORMANT</D3><D4>AVEC SON PRINCE</D4><TY>VILLE</TY><end of record>
000006 <RESARAIL-XML><SBO>A0011001A0A8809323254            </SBO><I1>>AU BOIS DORMANT</D3><D4>AVEC SON PRINCE</D4><TY>VILLE</TY><end of record>
000007 <RESARAIL-XML><SBO>A0011001A0A8809323262            </SBO><I1>>AU BOIS DORMANT</D3><D4>AVEC SON PRINCE</D4><TY>VILLE</TY><end of record>
****** **************************** Bottom of Dat********************
("<end of record>" added by Moderator)

Thanks a lot your very interesting responses

Pbe
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 May 06, 2010 2:08 am
Reply with quote

It's not clear from your post what you want to do. I don't know if you're showing two different input files, or an input and expected output file, or what. I don't know what you want to propagate or where you want to propagate it to.

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.

If these are really variable-length records (RECFM=VB), show the length of each input and output record to make it clear what you're trying to do with the records.
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 May 06, 2010 11:05 pm
Reply with quote

Based on the information you sent me in the PM, here's a DFSORT job that will do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...   HDR file (FB)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
  OPTION COPY
  INCLUDE COND=(1,4,CH,EQ,C'HDR1')
  INREC BUILD=(C'HDFLD,''',22,6,C'''',80:X)
/*
//S2 EXEC PGM=SORT
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN DD *
  OPTION COPY
  INREC OVERLAY=(45:HDFLD)
/*


Quote:
In the same time can i drop the 16 last bytes of each variables records which contains garbage.


I'm not sure what you mean by this. Do you want to drop the last 16 bytes starting from the same position in every record - what position?
Or do you want to drop bytes starting from a particular character in the record? Or do you want to drop 16 bytes from the end of each record based on the differrent lengths of the records? Or what?
Back to top
View user's profile Send private message
pbengine

New User


Joined: 16 Dec 2003
Posts: 5

PostPosted: Fri May 07, 2010 12:00 am
Reply with quote

It's so easy when you know the solution.

Thank's a lot for your help.
Back to top
View user's profile Send private message
pbengine

New User


Joined: 16 Dec 2003
Posts: 5

PostPosted: Fri May 07, 2010 1:50 am
Reply with quote

I need also to cut the right part of each record for a length of 16 bytes which contains garbage.

Length before LL

Length after LL-16

Pbengine
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri May 07, 2010 2:11 am
Reply with quote

pbengine wrote:
I need also to cut the right part of each record for a length of 16 bytes which contains garbage.

Length before LL

Length after LL-16

Pbengine


You need to define what constitutes as garbage. Are they Low-values (x'00' or high values (x'ff') or anything else?
Back to top
View user's profile Send private message
pbengine

New User


Joined: 16 Dec 2003
Posts: 5

PostPosted: Tue May 11, 2010 8:33 pm
Reply with quote

Each variable record is terminated by this XML tag </RESARAIL-XML>
followed by a 16 byte area which look like that
Code:
BSS SN  EüeM¬< a
CEE4ED44CD8DB408
222025005C54AC11

Which is put by emitting system. TPF guys say it's impossible not to write such a trailer. Sytems guys reasons are always strange and mysterious!!.

Pbengine
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue May 11, 2010 10:16 pm
Reply with quote

pbengine,

add the following control card
Code:

 OUTREC FINDREP=(IN=(C'BSS SN  EÜEM¬< A',C'BSS SN  EÜEM¬&­A'),
               OUT=C'')                                     


All the records that have either of those strings get truncated and the length will be updated. You can add as many as strings as you want.
Back to top
View user's profile Send private message
pbengine

New User


Joined: 16 Dec 2003
Posts: 5

PostPosted: Tue May 11, 2010 11:09 pm
Reply with quote

Thanks for your help
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 Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top