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: 7225

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: 7225

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: 7225

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: 7225

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: 1529
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: 7225

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
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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