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
 
Count the length of the record & display in a new line

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

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Mar 23, 2017 7:52 pm    Post subject: Count the length of the record & display in a new line
Reply with quote

Hi All,

Please could someone help me with a clever SORT to tackle below task -

Input file (FB dataset - XML way)
Code:

<DATARECORDS>ABCD  EF</FRMTDDATA>
<DATARECORDS>GHIJKLM</FRMTDDATA>
<DATARECORDS>NO P</FRMTDDATA>
<DATARECORDS>QRST  UVWXYZ</FRMTDDATA>


Expected Output
Code:

DATA,33
<DATARECORDS>ABCD  EF</FRMTDDATA>
DATA,32
<DATARECORDS>GHIJKLM</FRMTDDATA>
DATA,29
<DATARECORDS>NO P</FRMTDDATA>
DATA,37
<DATARECORDS>QRST  UVWXYZ</FRMTDDATA>


Thanks in advance.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2100
Location: UK

PostPosted: Thu Mar 23, 2017 8:01 pm    Post subject:
Reply with quote

If you want a sort answer why post in JCL & VSAM - neither of which are a Sort product - instead of posting in one of the Sort sections of the forum?
Topic moved.
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Mar 23, 2017 8:06 pm    Post subject: Reply to: Count the length of the record & display in a new line
Reply with quote

Oops. Sorry. My bad. Thanks for shifting it to SORT and next time I will be careful.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2413
Location: @my desk

PostPosted: Thu Mar 23, 2017 8:24 pm    Post subject:
Reply with quote

Converting to VB will help storing the length, in the first 2 bytes in BI format (part of RDW).
You could then write 2 records - first : the length from the first 2 bytes and second : the actual data.
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Mar 23, 2017 10:05 pm    Post subject: Reply to: Count the length of the record & display in a new line
Reply with quote

Hi Arun,

Thanks it worked.

Code:

//TOOLIN DD *                                           
COPY FROM(IN) USING(CTL1)                               
COPY FROM(T1) TO(OUT) USING(CTL2)                       
/*                                                       
//CTL1CNTL DD *                                         
  OUTFIL FNAMES=T1,FTOV,VLTRIM=X'00'                     
/*                                                       
//CTL2CNTL DD *                                         
  OUTFIL VTOF,                                           
  BUILD=(C'DATA,',1,2,BI,SUB,+4,TO=ZD,LENGTH=4,/,         
         5,3000)                                         
/*                                                       
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 Confusion regarding length of SQLCA v... Vivek0410 DB2 1 Thu Oct 18, 2018 2:20 pm
This topic is locked: you cannot edit posts or make replies. Get value from 2nd record and PUSH it... ashokakash JCL & VSAM 1 Wed Oct 17, 2018 11:41 am
No new posts Merge data from record pairs ashokakash DFSORT/ICETOOL 5 Wed Oct 17, 2018 11:38 am
No new posts Process only last key record in a fil... Naveen.katkuri24 DFSORT/ICETOOL 8 Tue Oct 09, 2018 9:39 am
No new posts SYNCSORT keep MIN/MAX record Cloink SYNCSORT 16 Mon Sep 17, 2018 3:00 pm

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