IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DFSORT: Can the above thing be done in one sort parm


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue Jun 10, 2008 12:31 am
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
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
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 Developer


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

PostPosted: Tue Jun 10, 2008 3:02 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top