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
 

 

DFSORT Spilt file based on Records

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

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Thu Feb 13, 2014 10:56 pm    Post subject: DFSORT Spilt file based on Records
Reply with quote

If "4444" is occurred at first time in input file then the record number should be taken and copy to entire records to output file. I am planning to write a dfsort can you you please help me.



Input File

1111
2222
3333
4444
5555
4444
6666
7777
.....
......
1000000


Output File

4444
5555
4444
6666
7777
.....
......
1000000
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Feb 13, 2014 11:04 pm    Post subject: Reply to: DFSORT Spilt file based on Records
Reply with quote

Fixed-length records or variable. That determines where you extend your data. IFTHEN=(WHEN=GROUP with BEGIN for your 4s value. OUTFIL INCLUDE= for the 4s (you only acttually need to PUSH one byte) and then BUILD to drop off the extended data.
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Fri Feb 14, 2014 8:17 am    Post subject:
Reply with quote

Its a fixed file.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Feb 14, 2014 2:09 pm    Post subject: Reply to: DFSORT Spilt file based on Records
Reply with quote

It wasn't actually a question (no question-mark). It was telling you how to determine where to extend your record. I think I've given you everything you need, Have a crack at it at least. If you get stuck, come back.
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Fri Feb 14, 2014 2:19 pm    Post subject:
Reply with quote

INREC IFTHEN=(WHEN=INIT,OVERLAY=(89:1,2)),
IFTHEN=(WHEN=GROUP,
BEGIN=(1,4,CH,EQ,C'4444'),
PUSH=(81:ID=8))
SORT FIELDS=COPY
OUTREC BUILD=(1,80)

As suggesed,I am trying this query but I am getting all the records to ouput fie but I need get only the below records

Output File

4444
5555
4444
6666
7777
.....
.....
.....

Please check this and let me know your ideas on this
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Fri Feb 14, 2014 2:33 pm    Post subject:
Reply with quote

I think this is what Bill meant...pls see code below

Code:

//SYSIN    DD    *                                 
  OPTION COPY                                     
  INREC IFTHEN=(WHEN=GROUP,                       
         BEGIN=(1,4,CH,EQ,C'4444'),PUSH=(81:ID=1))
  OUTFIL INCLUDE=(81,1,CH,GT,C' '),BUILD=(1,80)   


Thanks,
Ashwin.
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Fri Feb 14, 2014 2:59 pm    Post subject:
Reply with quote

Thanks Ashwin. I tried testing your sort card but above sort card also but I am getting the entire input records. Sequence # is not starting on C'4444' the records (i.e 4th record). I think something we have to modify this sort card
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Feb 14, 2014 3:55 pm    Post subject: Reply to: DFSORT Spilt file based on Records
Reply with quote

You have to post what you are using. I'd have done it slightly differently (PUSHed the first byte of the key, and then checked for equal to '4') but I can't see that Ashwin's control cards wouldn't work.
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Fri Feb 14, 2014 4:04 pm    Post subject:
Reply with quote

I am testing the below sort card but this sort is not filtering any records. I am getting entire input records to output file.
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,4,CH,EQ,C'4444')),
PUSH=(81:ID=8))
OUTFIL INCLUDE=(81,8,ZD,GT,00000000),BUILD=(1,80)
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Feb 14, 2014 5:10 pm    Post subject: Reply to: DFSORT Spilt file based on Records
Reply with quote

Humour me. Run the following, post the test results and the full sysout from the step.

Code:
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,
  BEGIN=(1,4,CH,EQ,C'4444')),
  PUSH=(81:ID=8))
  OUTFIL INCLUDE=(81,8,ZD,GT,00000000),BUILD=(1,40,81,8)


Then try this:

Code:
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,
         BEGIN=(1,4,CH,EQ,C'4444')),
         PUSH=(81:1,1))
  OUTFIL INCLUDE=(81,1,CH,EQ,C'4'),BUILD=(1,80)
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Fri Feb 14, 2014 6:30 pm    Post subject:
Reply with quote

Thanks a lot. Its working fine.

OPTION COPY
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,4,CH,EQ,C'4444')),
PUSH=(81:ID=8))
OUTFIL INCLUDE=(81,8,ZD,GT,00000000),BUILD=(1,40,81,8)
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1537
Location: Andromeda Galaxy

PostPosted: Fri Feb 14, 2014 6:48 pm    Post subject:
Reply with quote

Did you try the other solution suggested by Bill?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Feb 14, 2014 7:39 pm    Post subject: Reply to: DFSORT Spilt file based on Records
Reply with quote

The first wasn't a suggested solution, just an attempt to show what was happening...

How the output can be considered correct, I have no clue :-)
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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