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
 

 

Propagate information from HDR1 in variable length records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Propagate information from HDR1 in variable length records
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 Moderator


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

PostPosted: Thu May 06, 2010 2:08 am    Post subject:
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 Moderator


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

PostPosted: Thu May 06, 2010 11:05 pm    Post subject:
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    Post subject:
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    Post subject: Post subject: Propagate information from HDR1
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    Post subject: Re: Post subject: Propagate information from HDR1
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Propagate information from HDR1 in variable length
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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