Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Reformatting of O/P file based on I/P value

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

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue Aug 10, 2010 11:09 pm    Post subject: Reformatting of O/P file based on I/P value
Reply with quote

I have an I/P file like following :

1CNCLABC123
2DCHGBCD456
3CNCLABC456
4DCHGBCD123

Layout :
1st byte = Sequence no
2-5 byte = Category
6-8 byte = Code1
9-11 byte = Code2

Requirement:
O/P file should contain only Category and Code, total 7 bytes in length.
If category = 'CNCL' ------> then code = Code1 (6-8 byte)
If Category = 'DCHG' -----> then code = Code2 (9-11 byte).

Please help me to do this one using SORT utility.
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Tue Aug 10, 2010 11:14 pm    Post subject: Reply to: Reformatting of O/P file based on I/P value
Reply with quote

Debasis Misra,

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                   
1CNCLABC123                                       
2DCHGBCD456                                       
3CNCLABC456                                       
4DCHGBCD123                                       
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *
  INCLUDE COND=(2,4,SS,EQ,C'CNCL,DCHG')                                     
  SORT FIELDS=COPY                                 
  INREC IFOUTLEN=7,                               
  IFTHEN=(WHEN=(2,4,CH,EQ,C'CNCL'),BUILD=(2,7)),   
  IFTHEN=(WHEN=(2,4,CH,EQ,C'DCHG'),BUILD=(2,4,9,3))
//*                                               
Back to top
View user's profile Send private message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue Aug 10, 2010 11:24 pm    Post subject:
Reply with quote

Thanks a lot!, its working, I have tried now.
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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us