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

I/P file in which the record is flowing in multiple lines


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

New User


Joined: 06 May 2010
Posts: 17
Location: INDIA

PostPosted: Thu May 06, 2010 10:43 am
Reply with quote

Hi,

I m having a I/P file in which the record is flowing in multiple lines.

1ST RECORD LAYOUT:[/u]
1st ROW(1:2) = 10
2nd ROW (1:2) = 11 which is continued in the next line having 1st 2digit as 11(SEE THE 3RD LINE). The end of the 2nd ROW can be identified at the end of 3rd ROW(END* - Denotes the end).

1ST RECORD:
100000000000111111.AAAA.SE
110017NAME BISWARANJAN NAYAK0012
11CARD @@@@@@END*

2ND RECORD:
100000000000222222.BBBB.SE
110007NAME PRIYA V0012
11CARD @#####END*

Now I want to create a O/P file with:
111111.AAAA.SE BISWARANJAN NAYAK @@@@@@
222222.BBBB.SE PRIYA V @#####

Please let me know whether it's possible in DFSORT/ICETOOL?

Regards,
Biswa
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu May 06, 2010 1:05 pm
Reply with quote

To understand all of what you want, being psychic is not enough...
Quote:
1st ROW(1:2) = 10
2nd ROW (1:2) = 11

This is flat file. In file there are not rows but records.
I assume by above you mean

1st rec in rec group will start with '10'
2st rec in rec group will start with '11'
3rd rec in rec group will have 'END' from pos 14

Now looking at your sample records
Data required in output is
from 1 rec of group from 13 len 14
from 2 rec of group from 12 len (couldn’t guess)
from 3 rec of group from 8 len 6

Can you please confirm what I assumed is correct and provide how to identify name which I couldn't guess...

Also will there be always three records in the group as you shown?
What is LRECL\RECFM of the file?
Back to top
View user's profile Send private message
biswaranjan

New User


Joined: 06 May 2010
Posts: 17
Location: INDIA

PostPosted: Mon May 10, 2010 9:05 am
Reply with quote

Hi,

Thanks for the response.

Please find the deatils. The issue is in how to handle level'11' record.

Level = '10' -- 1ST two bytes of vaue '10'
Level = '11' -- 1st 2 bytes of value '11'

----------------------------------------------------------------------------------

1. 1st rec in rec group will start with '10' - Yes
2. 2st rec in rec group will start with '11' - Yes

The 2nd record in ideal condition should have:
110017NAME BISWARANJAN NAYAK0012CARD @@@@@@END*
But in this case it is overflowing to the next line and to identify this is a part of 2nd record the starting two bytes of the 3rd line is '11'.
110017NAME BISWARANJAN NAYAK0012
11CARD @@@@@@END*

3. Also will there be always three records in the group as you shown?
No. The '11' level record will have values in multiple lines(Min. 1 to max 10), But END* will always mark the end of leval'11' record.

4. 3rd rec in rec group will have 'END' from pos 14?
As mentioned above the END* just marks the end of '11' level record. It can be at any position of the record( FB - 240).

5. How to identify name which I couldn't guess... ?

Record level = '11', Tags will be : NAME, TEL, CARD, BID

0017 - LENTH, NAME - TAG, After that actual value of name of 17byte starting with a space always. Similarly for tags TEL, CARD, BID.
0017 is the length, but if it's of 10bytes data will always contain the actual value of 10, rest 7 bytes will not be space filled. The next character after the value will always contain a digit, i.e 1st byte of the actual length of 2nd tag(Ex: '0' as apart of next tag 0010TEL).

0017NAME BISWARANJAN NAYAK
0010TEL 0661247490012
0012CARD @@@@@@@@@@@0009BID 000000123END*

Actual record Layoutof level 11:
110017NAME BISWARANJAN NAYAK0010TEL06612474900120012--> 0 is the next byte just after the end of NAME tag actual value.
11CARD @@@@@@@@@@@0009
11BID 000000123END*


The LRECL of the mentioned file is = 240.

Regards,
Biswa
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: Tue May 11, 2010 2:49 am
Reply with quote

There might be a way to do what you want with DFSORT's PARSE function, but your explanation isn't clear enough for me to say.

Also, I can't determine where there are spaces in your records. It would really help if you would use ubb code tags so you could make the input and output records look the way they actually look.

Quote:
0017 is the length, but if it's of 10bytes data will always contain
the actual value of 10, rest 7 bytes will not be space filled. The
next character after the value will always contain a digit, i.e 1st
byte of the actual length of 2nd tag(Ex: '0' as apart of next tag
0010TEL).


I'm not sure what you mean by this but if you need to use the length in the second line to determine the bytes to extract in the third line and so on, DFSORT can't do that, so I suggest you write your own program or exit with the needed logic.
Back to top
View user's profile Send private message
biswaranjan

New User


Joined: 06 May 2010
Posts: 17
Location: INDIA

PostPosted: Mon May 31, 2010 7:34 pm
Reply with quote

Hi Frank,

I/P file is:
1020100510AN196703038247.FSPA.SE110017NAME BISWA11CARD123456
1020100510AN196703038290.FSPA.SE110017NAME PAM11CARD12345

O/P :

Code:

196703038247.FSPA.SE BISWA 123456
196703038290.FSPA.SE PAM     12345



In the record Name is varying.

Is this possible in SORT? This is a VB file.
Back to top
View user's profile Send private message
biswaranjan

New User


Joined: 06 May 2010
Posts: 17
Location: INDIA

PostPosted: Mon May 31, 2010 7:52 pm
Reply with quote

Hi,

I want to join Line 1,2 Line 3,4 Line 5,6 and so on.
Let me know if it pissible in SORT.



Code:

1020100510AN196703038247.FSPA.SE
110012NMN TEST TESTSON0000TLF 0012EPS test
1020100510AN196703038247.FSPA.SE
110012NMN TEST TESTSON0000TLF 0012EPS test99
1020100510AN196703038247.FSPA.SE
110012NMN TEST TESTSON0000TLF 0012EPS test10000
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 31, 2010 7:56 pm
Reply with quote

biswaranjan wrote:
Code:

196703038247.FSPA.SE BISWA 123456
196703038290.FSPA.SE PAM     12345
Did you intend the above or this:
Code:

196703038247.FSPA.SE BISWA 123456
196703038290.FSPA.SE PAM   12345
Back to top
View user's profile Send private message
biswaranjan

New User


Joined: 06 May 2010
Posts: 17
Location: INDIA

PostPosted: Mon May 31, 2010 8:00 pm
Reply with quote

The one newly added.
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 Jun 02, 2010 1:05 am
Reply with quote

Quote:
The one newly added.


If you mean this:

Quote:
I want to join Line 1,2 Line 3,4 Line 5,6 and so on.
Let me know if it pissible in SORT.


Code:

1020100510AN196703038247.FSPA.SE
110012NMN TEST TESTSON0000TLF 0012EPS test
1020100510AN196703038247.FSPA.SE
110012NMN TEST TESTSON0000TLF 0012EPS test99
1020100510AN196703038247.FSPA.SE
110012NMN TEST TESTSON0000TLF 0012EPS test10000


It seems to be different than the input, output and rules you were originally talking about, so I still have no idea what you want to do. "Join" how?

Please show the expected output records, and explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input and output files. Give the starting position, length and format of each relevant field.
Back to top
View user's profile Send private message
biswaranjan

New User


Joined: 06 May 2010
Posts: 17
Location: INDIA

PostPosted: Wed Jun 02, 2010 10:49 am
Reply with quote

Hi Frank,

I/P --> RECFM VB, LRECL=120
O/P --> RECFM VB, LRECL=240

Attachment deleted - content below. . .
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jun 02, 2010 10:51 am
Reply with quote

Code:

I/P file:
1020100510AN196703038247.FSPA.SE
110012NMN TEST TESTSON0000TLF 0012EPS test
1020100510AN196703038247.FSPA.SE
110012NMN TEST TESTSON0000TLF 0012EPS test99
1020100510AN196703038247.FSPA.SE
110012NMN TEST TESTSON0000TLF 0012EPS test10000
O/P File:
1020100510AN196703038247.FSPA.SE 110012NMN TEST TESTSON0000TLF 0012EPS test
1020100510AN196703038247.FSPA.SE 110012NMN TEST TESTSON0000TLF 0012EPS test99
1020100510AN196703038247.FSPA.SE 110012NMN TEST TESTSON0000TLF 0012EPS test10000

Moderators, Kindly delete above attachment... This is the content...

Done
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 Jun 02, 2010 11:19 pm
Reply with quote

Biswa,

Since the input and output are VB files, we have to take the record lengths into account. It isn't clear in what way you want to do that.
I don't know if you want each record padded out to 120 bytes before it is joined to the other record, or if you want the trailing blanks squeezed out, or what. You need to show an example with the length of each input record and the length of the joined output record, and explain exactly what you want.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top