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
 

 

Different types of records to be stored in memory and write

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 38
Location: Chicago

PostPosted: Sat Sep 15, 2007 1:43 am    Post subject: Different types of records to be stored in memory and write
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: 3158
Location: Tucson AZ

PostPosted: Sat Sep 15, 2007 2:14 am    Post subject:
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

Site Director


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

PostPosted: Sat Sep 15, 2007 2:29 am    Post subject:
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 Moderator


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

PostPosted: Sat Sep 15, 2007 2:55 am    Post subject:
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: 38
Location: Chicago

PostPosted: Thu Sep 20, 2007 11:42 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Sep 20, 2007 11:50 pm    Post subject:
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: 38
Location: Chicago

PostPosted: Thu Sep 20, 2007 11:56 pm    Post subject:
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: 38
Location: Chicago

PostPosted: Thu Sep 20, 2007 11:57 pm    Post subject:
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: 38
Location: Chicago

PostPosted: Fri Sep 21, 2007 12:10 am    Post subject:
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 Moderator


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

PostPosted: Fri Sep 21, 2007 1:31 am    Post subject:
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: 38
Location: Chicago

PostPosted: Fri Sep 21, 2007 1:35 am    Post subject:
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    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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts Can you write 2 recs on SORTOUT when ... Sysaron DFSORT/ICETOOL 6 Thu Feb 23, 2017 12:07 am


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