Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DFSORT Query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DFSORT Query
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: 2002
Location: UK

PostPosted: Thu Jul 05, 2012 1:24 pm    Post subject:
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    Post subject: Reply to: DFSORT Query
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

Moderator


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

PostPosted: Thu Jul 05, 2012 2:48 pm    Post subject:
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: 2002
Location: UK

PostPosted: Thu Jul 05, 2012 3:31 pm    Post subject:
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    Post subject:
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    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 How to force a select query to abend neo4u DB2 5 Mon Apr 23, 2018 1:36 pm
No new posts Need urgent suggestion on DFSORT subratarec DFSORT/ICETOOL 6 Wed Mar 21, 2018 8:46 pm
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am
No new posts How to replace the below query? pkmurali DB2 12 Tue Feb 27, 2018 9:51 pm
No new posts Need Guidance regarding UPDATE query Poha Eater DB2 3 Mon Feb 12, 2018 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us