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
 

 

SORT Format should be RECFM=VB,LRECL=350

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 22
Location: mumbai

PostPosted: Fri Jan 15, 2016 8:20 pm    Post subject: SORT Format should be RECFM=VB,LRECL=350
Reply with quote

Hi ,

I have a input file in the below format.
-------------------------------------------------------------------------------------
Code:
SQL> SET ECHO OFF                                                     
SQL> SET HEADING OFF                                                 
SQL> SET TERMOUT OFF                                                 
SQL> SET FEEDBACK OFF                                                 
SQL> SET TRIMSPOOL ON                                                 
SQL> SET PAGESIZE 0                                                   
SQL> SET COLSEP ','                                                   
SQL> SELECT TZR,PROP_CODE,TO_CHAR(INV_DATE,'YYYY'),'3001',           
  2         TO_CHAR(INV_DATE,'YYYY-MM-DD'),'0',USER_NOTES             
  3    FROM OYT_XP_DAILY_SPREAD                                       
  4    WHERE INV_DATE  BETWEEN  TO_DATE('02/01/2018','MM/DD/YYYY')   
3,BADPT,2018,3001,2018-02-01,0                                       
                                                                     
                                                                     
3,MADPT,2018,3001,2018-02-02,0                                       
                                                                     
                                                                     
3,CADPT,2018,3001,2018-02-03,0   

------------------------------------------------------------------------
Below is the input file formate,RECFM=VB,LRECL=1028.

I want out to be written as below,
Code:
BADPT,2018,3001,2018-02-01,0                                     
MADPT,2018,3001,2018-02-02,0 
CADPT,2018,3001,2018-02-03,0 


the Format should be RECFM=VB,LRECL=350.

Now i tried the below sort card,

Code:
 SORT FIELDS=COPY                 
 INCLUDE COND=(5,2,CH,EQ,C'1,',OR,
               5,2,CH,EQ,C'2,',OR,
               5,2,CH,EQ,C'3,')   
 OUTREC FIELDS=(1:7,5),CONVERT


But it is not working.

Could you please advise.

Thanks,
Sen

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

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Jan 15, 2016 8:36 pm    Post subject: Reply to: SORT
Reply with quote

It's not clear what you are expecting CONVERT to do. You have no data which starts with '1,' or '2,'. Is that a typo in your sample?

Get rid of the OUTREC, don't use FIELDS on OUTREC (or INREC or OUTFIL OUTREC).

This may be what you want.

Code:
  INREC BUILD=(1,4,7)
Back to top
View user's profile Send private message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 22
Location: mumbai

PostPosted: Fri Jan 15, 2016 8:51 pm    Post subject:
Reply with quote

The records in INPUT IS IN THE BELOW FORMATE(RCFM=VB,LRECL=1028)
Code:
SQL> SET ECHO OFF
SQL> SET HEADING OFF
SQL> SET TERMOUT OFF
SQL> SET FEEDBACK OFF
SQL> SET TRIMSPOOL ON
SQL> SET PAGESIZE 0
SQL> SET COLSEP ','
SQL> SELECT TZR,PROP_CODE,TO_CHAR(INV_DATE,'YYYY'),'3001',
2 TO_CHAR(INV_DATE,'YYYY-MM-DD'),'0',USER_NOTES
3 FROM OYT_XP_DAILY_SPREAD
4 WHERE INV_DATE BETWEEN TO_DATE('02/01/2018','MM/DD/YYYY')
3,BADPT,2018,3001,2018-02-01,0


3,MADPT,2018,3001,2018-02-02,0


3,CADPT,2018,3001,2018-02-03,0

After Sort i want ot extract only the below records from Input file and write it into outputfile.

BADPT,2018,3001,2018-02-01,0
MADPT,2018,3001,2018-02-02,0
CADPT,2018,3001,2018-02-03,0

The output file RECFM should be RECFM=FB,LRECL=350.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Jan 15, 2016 9:42 pm    Post subject: Reply to: SORT Format should be RECFM=VB,LRECL=350
Reply with quote

You've been a member here for six years+. Please use the code-tags to preserve spacing.


Code:
  OUTFIL BUILD=(7,346),VTOF


Your INCLUDE was basically correct, except for the three conditions, which only need be one.
Back to top
View user's profile Send private message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 22
Location: mumbai

PostPosted: Fri Jan 15, 2016 10:23 pm    Post subject:
Reply with quote

I am getting below error

Code:

 WER250A  INCLUDE/OMIT FIELD BEYOND RECORD       


when i use the below sort card
Code:

SORT FIELDS=COPY               
INCLUDE COND=(5,2,CH,EQ,C'3,')
OUTREC BUILD=(7,346),VTOF
Back to top
View user's profile Send private message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 22
Location: mumbai

PostPosted: Fri Jan 15, 2016 10:29 pm    Post subject:
Reply with quote

i tried

Code:

SORT FIELDS=COPY             
INCLUDE COND=(5,2,CH,EQ,C'3,')
OUTFIL BUILD=(7,346),VTOF     


still getting the error:
Code:

WER250A  INCLUDE/OMIT FIELD BEYOND RECORD
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Jan 15, 2016 10:49 pm    Post subject: Reply to: SORT Format should be RECFM=VB,LRECL=350
Reply with quote

Code:
  SORT FIELDS=COPY             
  INCLUDE COND=(5,2,CH,EQ,C'3,')
  OUTFIL IFTHEN=(WHEN=INIT,
                  OVERLAY=(351:X)),
         IFTHEN=(WHEN=INIT,
  BUILD=(7,342)),VTOF,VLTRIM=C' '     
Back to top
View user's profile Send private message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 22
Location: mumbai

PostPosted: Fri Jan 15, 2016 10:58 pm    Post subject:
Reply with quote

I am able to get the result by using PARM='VLTESTI=1'
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Jan 15, 2016 11:43 pm    Post subject: Reply to: SORT Format should be RECFM=VB,LRECL=350
Reply with quote

Next time explain what you mean by "not working", including any error messages in full.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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