| IBM MAINFRAME HELP & SUPPORT FORUMS Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
|
| View previous topic :: View next topic |
| Author |
Message |
srinivas.u
Joined: 07 Jun 2004
Posts: 20
|
| Posted: Sun Jun 20, 2004 11:08 pm Post subject: Record size is 70 i want retrive first 50 characters |
|
|
hi
in cobol file the record size is 70 i want retrive first 50 characters. |
|
| Back to top |
|
imvs
Joined: 12 May 2004
Posts: 33
|
| Posted: Sun Jun 20, 2004 11:34 pm Post subject: |
|
|
srinivas.u,
In order to discuss in the same topic you can use POST REPLY instead of
opening a new topic.
Comming to you question, there are couple of ways to do it.
1) 01 ws-rec.
02 ws-reqd-50-data pic x(50).
02 filler pic x(20).
display ws-reqd-50-data.
2) 01 ws-rec pic x(70).
01 ws-reqd-50-data.
move ws-rec(1:50) to ws-reqd-50-data.
display ws-reqd-50-data. |
|
| Back to top |
|
jz1b0c
Joined: 25 Jan 2004
Posts: 180
Location: Toronto, Canada
|
| Posted: Fri Nov 19, 2004 2:06 am Post subject: |
|
|
Srinivas,
Actually you dont need to do any thing like above simply a move statement will solve this.
01 ws-rec-70 pic x(70).
01 ws-rec-50 pic x(50).
MOVE WS-REC-70 TO WS-REC-50.
This will retrieve only first 50 characters and rest will be truncated. |
|
| Back to top |
|
muthukumarapandian
Joined: 08 Oct 2004
Posts: 44
Location: chennai, india
|
| Posted: Sun Feb 27, 2005 6:01 pm Post subject: |
|
|
Hi imvs,
reference modifier is possible in cobo 85 and versions after that, simply moving 70 bytes variable to 50 bytes variable will truncate and gives the required result. |
|
| Back to top |
|
ankyhunk
Joined: 05 May 2005
Posts: 102
Location: Navi Mumbai, India
|
| Posted: Fri May 06, 2005 1:44 pm Post subject: |
|
|
| You can also copy a 70 char dataset to 50 char dataset using IEBGENER utility |
|
| Back to top |
|
MainframeHelp4_u
Joined: 15 Aug 2006
Posts: 28
|
| Posted: Sat Sep 02, 2006 3:26 pm Post subject: try sort |
|
|
1) Keep o/p file length 50 characters, and with SORTIN is 70 bytes file & SORTOUT is 50 bytes file.. try this option...
2) with the help ofSORT : Copy first/any 50 characters to output DSN..
Cheers
Mainframehelp4_u |
|
| Back to top |
|
ofer71
Joined: 27 Dec 2005
Posts: 2039
Location: Israel
|
| Posted: Sun Sep 03, 2006 2:01 am Post subject: |
|
|
Or with REXX: "VAR1 = SUBSTR(VAR2,1,50)"
O. |
|
| Back to top |
|
| |
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
|