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 Question

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

New User


Joined: 23 Oct 2015
Posts: 12
Location: canada

PostPosted: Mon Mar 07, 2016 7:11 pm    Post subject: DFSort Question
Reply with quote

Hi
Based on Header record validation, I need to change a specific field in the detail record.

Let me know your thoughts

Thanks,
Krrp

In Type0 Col 15 is DDA then Change Col 19 to A for all Type1 records.

INPUT::
00000000001003DDA
10000000002TESTXYZA
10000000003TESTABCA
10000000004TESTRBCB
10000000005TESTCBCA
10000000006TESTDEVB
90000000007TRAILER

The ouptut should look like

00000000001003DDA
10000000002TESTXYZA
10000000003TESTABCA
10000000004TESTRBCA
10000000005TESTCBCA
10000000006TESTDEVA
90000000007TRAILER
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Mon Mar 07, 2016 7:50 pm    Post subject:
Reply with quote

1) We know you have a DFSort question because you posted in that part of the forum. Create a meaningful title for your topics.
2) use the code tags to present your code and data. This maintains any spacing and uses a fixed width font so that stuff lines up correctly
3) As your sample data, which is supposed to be representative of the data in your dataset, only has 1 type 0 record and it has DDA (presumably in the position you say, why not simply change your data if the record type is 1 - no need to go checking your typ 0?
Back to top
View user's profile Send private message
krrp

New User


Joined: 23 Oct 2015
Posts: 12
Location: canada

PostPosted: Mon Mar 07, 2016 8:01 pm    Post subject:
Reply with quote

Nic Clouston wrote:
1) We know you have a DFSort question because you posted in that part of the forum. Create a meaningful title for your topics.
2) use the code tags to present your code and data. This maintains any spacing and uses a fixed width font so that stuff lines up correctly
3) As your sample data, which is supposed to be representative of the data in your dataset, only has 1 type 0 record and it has DDA (presumably in the position you say, why not simply change your data if the record type is 1 - no need to go checking your typ 0?


Thanks Nic for your reply...

I just wanted to see if we could do it...I don't have any data. I'm in the design phase and see if we could change without changing the proc.

To your bullet point 3, it could be DDA/SAV etc...I just want to change if it is only DDA based on the file we process.

Thanks,
KRRP
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Mar 07, 2016 9:10 pm    Post subject: Reply to: DFSort Question
Reply with quote

Yes, of course you can do it. Design finished.
Back to top
View user's profile Send private message
krrp

New User


Joined: 23 Oct 2015
Posts: 12
Location: canada

PostPosted: Mon Mar 07, 2016 9:35 pm    Post subject: Re: Reply to: DFSort Question
Reply with quote

Bill Woodger wrote:
Yes, of course you can do it. Design finished.


Hi Bill
Can you please share with me with the sort statements for my above example?

Based on header record (DDA/SAV/ACH etc), I need to update the detail record field.

header record column 1 is 0
detail record column 1 is 1
trailer record column 1 is 9

Only when header record has DDA update the detail record. Else no changes.

Thanks,
Back to top
View user's profile Send private message
Pandora-Box

Moderator


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

PostPosted: Mon Mar 07, 2016 9:47 pm    Post subject:
Reply with quote

Try the steps below

1.Use When group
2.Then Push
3.Overlay
4.Reformat
Back to top
View user's profile Send private message
krrp

New User


Joined: 23 Oct 2015
Posts: 12
Location: canada

PostPosted: Mon Mar 07, 2016 9:52 pm    Post subject:
Reply with quote

Pandora-Box wrote:
Try the steps below

1.Use When group
2.Then Push
3.Overlay
4.Reformat


Thanks...Let me go through the manual and try it.
Back to top
View user's profile Send private message
krrp

New User


Joined: 23 Oct 2015
Posts: 12
Location: canada

PostPosted: Mon Mar 07, 2016 11:37 pm    Post subject:
Reply with quote

krrp wrote:
Pandora-Box wrote:
Try the steps below

1.Use When group
2.Then Push
3.Overlay
4.Reformat


Thanks...Let me go through the manual and try it.


Okay...it worked...here is what I did:

Code:
SORT FIELDS=COPY                                           
INREC IFTHEN=(WHEN=GROUP,                                   
      BEGIN=(1,1,CH,EQ,C'0',AND,15,3,CH,EQ,C'DDA'),         
      PUSH=(251:15,3))                                     
                                                           
OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1',AND,19,1,CH,EQ,C'B',   
               AND,251,3,CH,EQ,C'DDA'),                     
      OVERLAY=(19:C'A'))   



Thanks much for all your help!!

Thanks
Krrp


Code'd
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Mar 08, 2016 5:20 am    Post subject: Reply to: DFSort Question
Reply with quote

Code:
 SORT FIELDS=COPY                                           
 INREC IFTHEN=(WHEN=GROUP,                                   
      BEGIN=(1,1,CH,EQ,C'0',AND,15,3,CH,EQ,C'DDA'),         
      PUSH=(251:15,3)),                                     
       IFTHEN=(WHEN=(1,1,CH,EQ,C'1',AND,19,1,CH,EQ,C'B',   
               AND,251,3,CH,EQ,C'DDA'),                     
      OVERLAY=(19:C'A'))


Although your sample data is limited, test your code well. You have no "END" to limit the WHEN=GROUP, so the PUSH will potentially affect every record following, even if it is another "header" and the records belonging to that header.
Back to top
View user's profile Send private message
krrp

New User


Joined: 23 Oct 2015
Posts: 12
Location: canada

PostPosted: Tue Mar 08, 2016 7:53 pm    Post subject: Re: Reply to: DFSort Question
Reply with quote

Bill Woodger wrote:
Code:
 SORT FIELDS=COPY                                           
 INREC IFTHEN=(WHEN=GROUP,                                   
      BEGIN=(1,1,CH,EQ,C'0',AND,15,3,CH,EQ,C'DDA'),         
      PUSH=(251:15,3)),                                     
       IFTHEN=(WHEN=(1,1,CH,EQ,C'1',AND,19,1,CH,EQ,C'B',   
               AND,251,3,CH,EQ,C'DDA'),                     
      OVERLAY=(19:C'A'))


Although your sample data is limited, test your code well. You have no "END" to limit the WHEN=GROUP, so the PUSH will potentially affect every record following, even if it is another "header" and the records belonging to that header.


Thanks Bill for you input. I'll update my package so I don't forget.

Thanks,
Krrp
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 get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm


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