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 Outrec Formatting
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu Jun 14, 2012 4:37 pm    Post subject: DFSORT Outrec Formatting
Reply with quote

Hi,

I have a VB file with the following records:
Code:
----+----1----+- ---2----+----3----+----4----+----5----+----6----+---
********************************* TOP OF DATA 0           /      *                                 
3  al       m@10     ATSBATSBTEST AABDUAL BUSVCC   X
3  al       m 10     ATSBATSBTEST AABDUAL BUSVCC   X
3  al       m@10     ATSBATSBTEST AABDUAL BUSVCC   G
3  al       m 10     ATM8ATM8TEST AABDUAL BUSVCC   G
3       d*  m@10     ELS0ELS0TEST AABDUAL VLUBCC   X
3       d*  m 10     ELS0ELS0TEST AABDUAL VLUBCC   X
3       e   m@10     AAAAAAAATEST AABDUAL VLUBCC   G
3       e   m 10     AAAAAAAATEST AABDUAL VLUBCC   G
3           m@10     AAAAAAAATEST AABDUAL VLDDBT   X
3           m 10     AAAAAAAATEST AABDUAL VLDDBT   X
3           m@10     AAAAAAAATEST AAVDUAL VLDDBT   G
3           m 10     AAAAAAAATEST AAVVDUAL VLDDBT   G
******************************** BOTTOM OF DATA ********************


I want to include the transactions(i.e.col 25 length 4) ATSB OR ELS0 OR ELS1 and the record type =3(i.e. col 1 length 1).
Also I need to format the output file:
If it is ATSB transaction then C' I MADE CHANGES'.
If it is ELS0 transaction then C' U MADE CHANGES'.

MY SORT CARD IS AS FOLLOWS AND NOT SURE IT IS A CORRECT APPROACH:

Code:
OPTION COPY                                                   
INCLUDE COND=(01,01,CH,EQ,C'3',AND,(25,4,CH,EQ,C'ATSB',       
        OR,25,4,CH,EQ,C'ELS0',OR,25,4,CH,EQ,C'ELS1'))         
OUTREC IFTHEN=(WHEN=INIT,                                     
       BUILD=(1:6,9,11:25,4)),                                 
OUTREC IFTHEN=(WHEN=(25,4,CH,EQ,C'ATSB'),                     
        OVERLAY=(11:C'I MADE CHANGES      ')),           
OUTREC IFTHEN=(WHEN=(25,4,CH,EQ,C'ELS0'),                     
        OVERLAY=(11:C'U MADE CHANGES     '))           
RECORD TYPE=F,LENGTH=80   


JOB:

Code:
//SRT01#06 EXEC PGM=SORT                                   
//*                                                         
//SYSOUT   DD  SYSOUT=*                                     
//SORTIN   DD  DSN=AAA1.LOG,DISP=SHR         
//SORTOUT  DD  DSN=AAA1.LOG.SRT,DISP=OLD               
//*            DCB=(RECFM=FB,LRECL=80),                     
//*            SPACE=(CYL,(20,20)),UNIT=SYSDA               
//SYSIN    DD  DSN=AAA1.PROCPARM(AAA1SRT),DISP=SHR     
//*                                                         
       
Back to top
View user's profile Send private message

Pandora-Box

Moderator


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

PostPosted: Thu Jun 14, 2012 4:53 pm    Post subject:
Reply with quote

Ok what happen when you executed this job and what was the error that you had got if any?? or what was the output you had got and what was expected??
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Thu Jun 14, 2012 4:55 pm    Post subject:
Reply with quote

Hello abhijit.nayak01,

Could you tell us what o/p did you get? And how the expected o/p should look?
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu Jun 14, 2012 5:22 pm    Post subject:
Reply with quote

Code:
ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL                                     
ICE007A 1 SYNTAX ERROR                                                         
ICE002I 0 DUPLICATE OR CONFLICTING OUTREC   STATEMENT                           
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY           
ICE002I 0 DUPLICATE OR CONFLICTING OUTREC   STATEMENT                           
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY           
ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E7-K70685                     
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 12:37 ON THU JU
           OPTION COPY                                                         
           INCLUDE COND=(01,01,CH,EQ,C'3',AND,(25,4,CH,EQ,C'ATSB',             
                   OR,25,4,CH,EQ,C'ELS0',OR,25,4,CH,EQ,C'ELS1'))               
           OUTREC IFTHEN=(WHEN=INIT,                                           
                  BUILD=((1:6,9,11:25,4)),
           OUTREC IFTHEN=(WHEN=(25,4,CH,EQ,C'ATSB'),                       
ICE002I 0 DUPLICATE OR CONFLICTING OUTREC   STATEMENT                     
                   OVERLAY=(11:C'I MADE CHANGES         ')),           
                   $                                                       
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY     
           OUTREC IFTHEN=(WHEN=(25,4,CH,EQ,C'ELS0'),                       
ICE002I 0 DUPLICATE OR CONFLICTING OUTREC   STATEMENT                     
                   OVERLAY=(11:C'U MADE CHANGES    '))             
                   $                                                       
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY     
           RECORD TYPE=F,LENGTH=80                                         
ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E7-K70685               
ICE052I 3 END OF DFSORT                                                                                         

my output should be:

Code:
111111111 I MADE CHANGES
111111112 I MADE CHANGES
111111132 I MADE CHANGES
111111231 U MADE CHANGES
111111243 U MADE CHANGES
the first 9 digits of output file is hexadecimal value from the input file from position 2(i.e. position 6 as it is VB) with length 9
which is S9(17)
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Thu Jun 14, 2012 6:42 pm    Post subject:
Reply with quote

1. Did you try to at least resolve the errors (syntactical errors)?

2. It would then be much easier for you to compare the o/p you get and expected o/p and change the sort card accordingly.

3. No idea what you saying...
Quote:
the first 9 digits of output file is hexadecimal value from the input file from position 2(i.e. position 6 as it is VB) with length 9
which is S9(17)

4. Hint #1 - Such a problem is already discussed/resolved recently. I personally feel there is no need for 'IFTHENs'.

5. period.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu Jun 14, 2012 7:04 pm    Post subject:
Reply with quote

I am actually concerned about the OUTREC approach and not sure whether my approach is correct. Meanwhile igore the 1st 9 digit thing.
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Thu Jun 14, 2012 7:29 pm    Post subject:
Reply with quote

Ohh, i don't know how I missed.. why have you used OUTREC thrice.

and 'DUPLICATE' per se means ??? you know, right?

and please read the manual/s (Link at the top).

There was once a time I used to be very busy, then I read the manuals... and I have lot of free time now icon_biggrin.gif... I hope you get it.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu Jun 14, 2012 8:00 pm    Post subject:
Reply with quote

Thanks Naish for your correction. So dumb I am. The job ran fine without issue.
Now the output for the desire outrec also came fine.
Coming to the first 9 digit from input file which are hexadecimal value are not getting displayed. Is there any solution for that.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jun 14, 2012 8:05 pm    Post subject:
Reply with quote

Hello,

Suggest you show what you want as output for the unprintable/non-display fields.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 14, 2012 8:05 pm    Post subject:
Reply with quote

it is all hexadecimal on z/OS.

what you mean is non display characters,
which means the field is either binary or packed-decimal.

since it is obvious you have no clue,
view the file and use the hex on option.
then cut and paste the results of a few records for the 1st 10 or so positions,
and someone will tell you what is there.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Thu Jun 14, 2012 8:24 pm    Post subject:
Reply with quote

The input file is as below and from col 2 to col 11 has packed decimal s9(17) comp3:

Code:
----+----1----+- ---2----+----3----+----4----+----5----+----6-
********************************* TOP OF DATA ****************
0           /      *                                         
F000000000036244 115444444444444444444444444444444444444444444
000000000C101C00 26C000000000000000000000000000000000000000000
--------------------------------------------------------------
3  al       m@10     ATSBATSBTEST EMVDUAL BUSVCC   X         
F0289300130297FF 002ACEECCEECECEE4CDECECD4CEEECC444E4000000010
347134048C014C10 0060132213223523054544130242533000700000C045C
--------------------------------------------------------------
3  al       m 10     ATSBATSBTEST EMVDUAL BUSVCC   X         
F0289300130298FF 002ACEECCEECECEE4CDECECD4CEEECC444E4000000019
347134048C014C10 0060132213223523054544130242533000700000C045C
--------------------------------------------------------------
3  al       m@10     ATSBATSBTEST EMVDUAL BUSVCC   G         
F0289300110297FF 002ACEECCEECECEE4CDECECD4CEEECC444C4000000010
347134049C014C10 0060132213223523054544130242533000700000C045C



in my output file for first record type 3 I am getting the following output :

Code:
000001        m@ i made changes   
V      30013029748498884888988A4444
V      4048C014C0904145038157520000
but i am expecting the 1st 9 digits in displayable format:
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Thu Jun 14, 2012 9:08 pm    Post subject:
Reply with quote

Hello abhijit.nayak01,

1. Last thing first, you didn't answer Pandora-box's question.

2. You have not shown us what sort card you have used.

3. Also your packed decimal data ends @ position 10. PIC S9(17) COMP-3 is ???

4. Suggest you READ THIS and also read about the difference between PD and ZD.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jun 14, 2012 9:16 pm    Post subject:
Reply with quote

Hello,

Quote:
Meanwhile I didnt got that error.
Does this mean the process worked as needed or is there some other error . . . ?

If you post your solution (JCL and sort control statements) it may help someone else with a similar problem later.

Please use the "Code" tag when posting this.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jun 14, 2012 9:36 pm    Post subject: Reply to: Outrec Formatting Doubt
Reply with quote

abhijit.nayak01,

Couple of errors with your control cards.

1. You can only specify 1 OUTREC parm.
2. When you use WHEN=INIT, you already modified the record, the subsequent IFTHEN should be based on the modified record by WHEN=INIT
3. Since your Input is a VB and you want a FB file you need to use the parm VTOF

If I understand your requirement correctly the following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN=Your Input VB file,DISP=SHR                             
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
  INCLUDE COND=(5,1,ZD,EQ,3,AND,25,4,SS,EQ,C'ATSB,ELS0,ELS1')
  INREC BUILD=(1,4,6,9,PD,M26,X,25,4)                       
                                                             
  OUTFIL VTOF,                                               
  BUILD=(5,23,X,                                             
         24,4,CHANGE=(20,C'ATSB',C'I MADE CHANGES',         
                         C'ELS0',C'U MADE CHANGES',         
                         C'ELS1',C'NO ONE CHANGED'),80:X)   
//*


If you insist on using IFTHEN then use the following control cards

Code:

//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                 
  INCLUDE COND=(5,1,ZD,EQ,3,AND,25,4,SS,EQ,C'ATSB,ELS0,ELS1')       
  INREC BUILD=(1,4,6,9,PD,M26,X,25,4)                               
                                                                   
  OUTREC IFOUTLEN=84,                                               
  IFTHEN=(WHEN=(24,4,CH,EQ,C'ATSB'),OVERLAY=(29:C'I MADE CHANGES')),
  IFTHEN=(WHEN=(24,4,CH,EQ,C'ELS0'),OVERLAY=(29:C'U MADE CHANGES')),
  IFTHEN=(WHEN=(24,4,CH,EQ,C'ELS1'),OVERLAY=(29:C'NO ONE CHANGED'))
                                                                   
  OUTFIL VTOF,BUILD=(5,80)                                         
//*



The output would be

Code:

+00000000000000001 ATSB I MADE CHANGES
+00000000000000002 ATSB I MADE CHANGES
+00000000000000003 ATSB I MADE CHANGES
+00000000000000005 ELS0 U MADE CHANGES
+00000000000000006 ELS0 U MADE CHANGES
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Fri Jun 15, 2012 4:17 pm    Post subject:
Reply with quote

Hi,

Sorry for the late response as I started work now. The above one with IFTHEN worked fine and I ussed the exatly the same one. I got the following output:
Code:
+05120570300121171 ATSB I MADE CHANGES.

Can you please tell me how I am going to remove the +0.
And can you please explan me from INREC statement.

Meanwhile I am unfortunate that the requirement got chnaged and now they only want ATSB and dont want "I MADE CHANGES" as the file can only be length of 80 and there are some new fields which I need to insert into the output file. icon_sad.gif

On the previous posts I only removed the multiple outrec statements as suggested and that worked fine.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jun 15, 2012 9:42 pm    Post subject:
Reply with quote

abhijit.nayak01 wrote:
Hi,

Sorry for the late response as I started work now. The above one with IFTHEN worked fine and I ussed the exatly the same one. I got the following output:
Code:
+05120570300121171 ATSB I MADE CHANGES.

Can you please tell me how I am going to remove the +0.
And can you please explan me from INREC statement.


abhijit.nayak01,

Your PD field can contain both positive and negative numbers. What do you plan to do with the signs? or do you always have ONLY positive numbers?

The explanation of INREC.

1,4 = RDW
6,9,PD = your input PD field at pos 6 for 9 bytes.
M26 = predefined edit mask . Check this link for Table 42. Edit Mask Patterns

X = Space

25,4 = your input field at pos 25 for 4 bytes.


Now if you need to add any other fields then you can add them at the end.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Mon Jun 18, 2012 12:51 pm    Post subject:
Reply with quote

Thanks Skolusu. Here the PD decimal is always positive.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Mon Jun 18, 2012 2:38 pm    Post subject:
Reply with quote

Hi Skolusu,

If the scenario is:
If ATSB/ELS1 then select the column 89 length 25 from input file and if it is ELS0 then select the column 386 length 25.

Can it be possible to retrofit the above also.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jun 18, 2012 9:59 pm    Post subject:
Reply with quote

abhijit.nayak01,

Use the following control cards

Code:

//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  INCLUDE COND=(5,1,ZD,EQ,3,AND,25,4,SS,EQ,C'ATSB,ELS0,ELS1')   
                                                                 
  INREC IFTHEN=(WHEN=(25,4,SS,EQ,C'ATSB,ELS0'),                 
         BUILD=(1,4,6,9,PD,M11,LENGTH=17,X,25,4,X,89,25,84:X)), 
        IFTHEN=(WHEN=(25,4,CH,EQ,C'ELS1'),                       
         BUILD=(1,4,6,9,PD,M11,LENGTH=17,X,25,4,X,386,25,84:X)) 
                                                                 
  OUTFIL VTOF,BUILD=(5,80)                                       
//*
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 157
Location: South Africa

PostPosted: Tue Jun 19, 2012 5:18 pm    Post subject:
Reply with quote

Thanks Kolusu,

I got the output exactly what I needed. I used the below sort card :
Code:
SORT FIELDS=COPY                                                   
INCLUDE COND=(5,1,ZD,EQ,3,AND,25,4,SS,EQ,C'ATSB,ELS0,ELS1')       
                                                                   
INREC IFTHEN=(WHEN=(25,4,SS,EQ,C'ATSB,ELS0'),                     
       BUILD=(1,4,6,9,PD,M11,LENGTH=16,X,25,4,X,390,25,X,417,25,X,
              84:X)),                                             
      IFTHEN=(WHEN=(25,4,CH,EQ,C'ELS1'),                           
       BUILD=(1,4,6,9,PD,M11,LENGTH=16,X,25,4,X,66,25,X,93,25,X,   
              84:X))                                               
                                                                   
OUTFIL VTOF,BUILD=(5,80)       


and the output is:

Code:
0036424102030022 ATSB 000001050                 000001050
0036424102030022 ATSB 000001050            000001050 
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
Goto page 1, 2  Next
Page 1 of 2

 

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 SORT- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 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 DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am


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