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

Different types of records to be stored in memory and write


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

New User


Joined: 10 Aug 2007
Posts: 32
Location: Chicago

PostPosted: Sat Sep 15, 2007 1:43 am
Reply with quote

Hello Frank,

I have a scenario which can be done by a COBOL program. However, I was wondering if we could do it thru sort. Let me make you understand it.

INPUT FILE:
1. AA12345
2. BB12345
3. CC33333
4. DD33333
5. DD33333
6. DD33333
7. EE55555
8. FF555555

All the above records form a set of records, so basically AA is like 00 BB 01 CC 02... so on and so forth...
Requirement is based on the value in 3rd record i.e, CC some value in 1st record AA should get picked up.

Is this possible in SORT/ICETOOL?

If you think I AM JUST NOT CLEAR don't bash me up... I am patient enuf to right with a few more details.

Thanks,
Dinesh
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Sep 15, 2007 2:14 am
Reply with quote

Not enough information....
Your best bet is to provide what you expect the output will look like and explain why.....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Sep 15, 2007 2:29 am
Reply with quote

Hello,

In addition to the output Bill requested, please specify the processing rules. When you show the output, show the complete output from all input posted, not just the first iteration.

It will also help if you mention the recfm and lrecl for the input and output.
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: Sat Sep 15, 2007 2:55 am
Reply with quote

Quote:
Requirement is based on the value in 3rd record i.e, CC some value in 1st record AA should get picked up.


I don't understand what you mean by this. What is the relationship betwee the CC record and the AA record? What are the exact rules for the requirement? Please provide the info William and Dick asked for.
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 32
Location: Chicago

PostPosted: Thu Sep 20, 2007 11:42 pm
Reply with quote

Sorry folks,

I was a lil busy with somethin else. Anyway,
this is how the input looks.

001122334455 (Header record)
01ASDFASDFASDF
02ASDFASDFASDF
03AAAAA
04ASDFASDFASDF
05ASDFASDFASDF
99ASDFASDFASF(TRAILER RECORD)
002233445566 (Header record)
01ASDFASDFASDF
02ASDFASDFASDF
03AAAAA (after 03 the data is junk... could be anything)
04ASDFASDFASDF
05ASDFASDFASDF
99ASDFASDFASF(TRAILER RECORD)
003344556677 (Header record)
01ASDFASDFASDF
02ASDFASDFASDF
04ASDFASDFASDF
05ASDFASDFASDF
99ASDFASDFASF(TRAILER RECORD)

Output should be:
1122334455
2233445566
(these are the account numbers picked from '00' record type)

only...

and not
3344556677 just because in the 3rd set of records there is no record
that starts with 03(which is record type)
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Sep 20, 2007 11:50 pm
Reply with quote

You want the account number from the header record if there exists an 03 type record between the header (00) and the trailer (99), right?
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 32
Location: Chicago

PostPosted: Thu Sep 20, 2007 11:56 pm
Reply with quote

Bad ending... I just forgot...

neway... if you happen to understand please give me the solution... else, ask me... FOR A BETTER EXPLANATION...

Thanks
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 32
Location: Chicago

PostPosted: Thu Sep 20, 2007 11:57 pm
Reply with quote

That's right... William... bang on!!!
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 32
Location: Chicago

PostPosted: Fri Sep 21, 2007 12:10 am
Reply with quote

I am sorry for late updates...

it is possible to have more than 1 '03' record type...

IF SOMEBODY IS READY WITH THE SOLUTION AND THEN SAW THIS MESSAGE... MY APOLOGIES...
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: Fri Sep 21, 2007 1:31 am
Reply with quote

dinesh,

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but you can change the job appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN DD DSN=...  input file (FB/80)
//OUT DD DSN=...  output file (FB/10)
//TOOLIN   DD    *
SELECT FROM(IN) TO(OUT) ON(81,8,ZD) FIRSTDUP USING(CTL1)
/*
//CTL1CNTL DD *
  INCLUDE COND=(1,2,SS,EQ,C'00,03')
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,2,CH,EQ,C'00'),
                OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(89:SEQNUM,8,ZD,
                         81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
  OUTFIL FNAMES=OUT,BUILD=(3,10)
/*
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 32
Location: Chicago

PostPosted: Fri Sep 21, 2007 1:35 am
Reply with quote

Awesome! Thanks Frank...
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top