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: Can the above thing be done in one sort parm

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

New User


Joined: 12 May 2008
Posts: 13
Location: Hartford

PostPosted: Mon Jun 09, 2008 11:11 pm    Post subject: DFSORT: Can the above thing be done in one sort parm
Reply with quote

Hi,

I have a input file having records in below format.

350 011458 9856124 NOT PCCL POLICY
350 012472 7921002 UNSUCCESSFUL MOVE TO ACCT
375 013479 7864321 INVALID PIN
375 014987 8521471 INVALID PIN

The first 3 bytes are transaction type.
Using Sort I want to create a New file

if 350 then
D90011458 90 is to be inserted
D90012472 90 is to be inserted

If 375 then
D967864321 96 is to be inserted
D968527471 96 is to be inserted

So the file will have 4 records.
D90011458
D90012472
D967864321
D968527471

I can do the above by using 2 step sort. one sort for 350 and other sort for 375. using INCLUDE.

but not able to do it in one sort.

Can the above thing be done in one sort parm?

Can any body help ?

Thanks,
Vikas
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jun 10, 2008 12:31 am    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
350 011458 9856124 NOT PCCL POLICY
350 012472 7921002 UNSUCCESSFUL MOVE TO ACCT
375 013479 7864321 INVALID PIN
375 014987 8521471 INVALID PIN
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(1,3,SS,EQ,C'350,375')
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'350'),
    BUILD=(C'D90',5,6)),
   IFTHEN=(WHEN=(1,3,CH,EQ,C'375'),
    BUILD=(C'D96',12,6))
/*
Back to top
View user's profile Send private message
Vsonawane

New User


Joined: 12 May 2008
Posts: 13
Location: Hartford

PostPosted: Tue Jun 10, 2008 2:34 am    Post subject:
Reply with quote

Thanks Frank! You are the best.

One more thing my input file is VB and i want the output file as FB.. i tried giving CONVERT in the SYSIN but not successful. Could you please suggest?

Thanks
Vikas
Back to top
View user's profile Send private message
Vsonawane

New User


Joined: 12 May 2008
Posts: 13
Location: Hartford

PostPosted: Tue Jun 10, 2008 2:47 am    Post subject:
Reply with quote

Hi Frank, Here is the actual sort which i am using.

Is there any way if i can build the outrec of FB?

SORT FIELDS=COPY
INCLUDE COND=(69,3,SS,EQ,C'350,351,370,470,352,357,368')
INREC IFTHEN=(WHEN=(69,3,CH,EQ,C'350',OR,
69,3,CH,EQ,C'351',OR,
69,3,CH,EQ,C'370',OR,
69,3,CH,EQ,C'470'),
BUILD=(1,4,C'D',
6X,
14X,
C'90',
230,17,
17X,
20X)),
IFTHEN=(WHEN=(69,3,CH,EQ,C'352',OR,
69,3,CH,EQ,C'357',OR,
69,3,CH,EQ,C'368'),
BUILD=(1,4,C'D',
6X,
14X,
C'96',
291,17,
17X,
20X))

Thanks,
Vikas
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jun 10, 2008 3:02 am    Post subject:
Reply with quote

Since your input is VB, I assume you're counting the RDW when you figure out the starting positions - right?

To convert from VB to FB, use an OUTFIL statement like this:

Code:

   OUTFIL VTOF,BUILD=(5,n)


where n is the length you want for the FB output records. From your example, it looks like n would be 77.

Quote:
i tried giving CONVERT in the SYSIN but not successful


This kind of statement is not helpful unless you show the control statements you tried to use to do the convert and the error messages you received.
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm


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