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 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: 1722
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: 1530
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: 1722
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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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