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

DFSORT Query


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

New User


Joined: 17 Jul 2007
Posts: 41
Location: pune

PostPosted: Thu Jul 05, 2012 11:51 am
Reply with quote

Hi,

I have a input File with below format:

Code:
HDR1 XXXX SRINATHD YYYYYYYY AAAAA BBBBBB $NEWSELLL ---- 
01,111111111,1111111111,111111,1111,1,11,/               
02,2222222222,222222222,1,120704,2222,/                 
03,333,33333333,0,3333333333333,NONE,120615 SRINATH
04,4444444444455555555555                             
EOF1 XXXX SRINATHD YYYYYYYY AAAAA BBBBBB $NEWSELLL 00000 00000 0000000 6666666

HDR1 XXXX RAVINDER YYYYYYYY AAAAA BBBBBB $NEWSELLL ---- 
01,111111111,1111111111,111111,1111,1,11,/               
02,2222222222,222222222,1,120704,2222,/                 
03,333,33333333,0,3333333333333,NONE,120615 SRINATH
04,4444444444455555555555                             
EOF1 XXXX RAVINDER YYYYYYYY AAAAA BBBBBB $NEWSELLL 00000 00000 0000000 9999999

HDR1 XXXX HEMANTHA YYYYYYYY AAAAA BBBBBB $NEWSELLL ---- 
01,111111111,1111111111,111111,1111,1,11,/               
02,2222222222,222222222,1,120702,2222,/                 
03,333,33333333,0,3333333333333,NONE,120615 SRINATH
04,4444444444455555555555                             
EOF1 XXXX HEMANTHA YYYYYYYY AAAAA BBBBBB $NEWSELLL 00000 00000 0000000 22222222


If in 02 record level the date is equal to prior date i.e.( today's Date -1). Then write the EOF1 record with only Highlighted Field.

O/P Should be:

Code:
SRINATHD | 6666666
RAVINDER | 9999999

I have written the Sort Card But it's not working. Please suggest the Solution:

Code:
//SYSIN DD *
OPTION COPY

INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'02',AND,27,6,CH,EQ,Y'DATE1'-1),
END=(1,4,CH,EQ,C'EOF1'),PUSH=(81:ID,2))
OUTFIL INCLUDE=(1,4,CH,EQ,C'EOF1',AND,81,2,CH,NE,C' '), 
BUILD=(11,8,9X,C' | ',72,8,52X)
/*





Code'd. Please use the Code tags, not text enhancements, as the Code preserves the space. If anyone wants to use your data for testing, they are not going to bother if it has enhancements to delete everywhere.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jul 05, 2012 1:24 pm
Reply with quote

How is it not working? Also, you seem to have managed to use code tags for you JCL and sort cards but not your data and it is just as important, if not more so, to encode your data.
Back to top
View user's profile Send private message
srinathds83

New User


Joined: 17 Jul 2007
Posts: 41
Location: pune

PostPosted: Thu Jul 05, 2012 2:42 pm
Reply with quote

Hi Nic,

when i tried running this Sort Card, It throws an error stating problem with INREC.

Thanks and Regards,

Srinath D.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


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

PostPosted: Thu Jul 05, 2012 2:48 pm
Reply with quote

May be try this

Code:

 OPTION COPY
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'02'),
 END=(1,4,CH,EQ,C'EOF1'),PUSH=(81:27,6))
 OUTFIL INCLUDE=(1,4,CH,EQ,C'EOF1',AND,81,6,Y2T,EQ,Y'DATE1'-1),
 BUILD=(11,8,9X,C' | ',72,8,52X)
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jul 05, 2012 3:31 pm
Reply with quote

WHAT error - just post your messages
Back to top
View user's profile Send private message
srinathds83

New User


Joined: 17 Jul 2007
Posts: 41
Location: pune

PostPosted: Thu Jul 05, 2012 4:14 pm
Reply with quote

Pandora-Box wrote:
May be try this

Code:

 OPTION COPY
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'02'),
 END=(1,4,CH,EQ,C'EOF1'),PUSH=(81:27,6))
 OUTFIL INCLUDE=(1,4,CH,EQ,C'EOF1',AND,81,6,Y2T,EQ,Y'DATE1'-1),
 BUILD=(11,8,9X,C' | ',72,8,52X)



Thanks !!!! This worked perfectly. After changing the Comparision value to Y2T even my Sort Card ran perfectly.

Thanks and Regards,

Srinath
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts RC query -Time column CA Products 3
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top