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

Move a var from nth pos in a file to 1st position of another


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sudhanshu Shekhar

New User


Joined: 23 Jul 2008
Posts: 27
Location: City of Joy

PostPosted: Tue Feb 24, 2009 5:50 pm
Reply with quote

Code:

IF INPUT-CHAR-1 (WS-IND1) = '****'
    MOVE INPUT-CHAR-1(WS-IND1) TO INPUT-CHAR-2 (WS-IND2)



But the first file is of a variable length while the file the INPUT-CHAR-2 will be written is of FB 25, so i want the code to move INPUT-CHAR-1(WS-IND1) TO INPUT-CHAR-2(0), i.e, the first position in 2nd file. How do i do that ?

As for the existing code it throws the error

Code:

NOT ENOUGH SUBSCRIPTS OR INDICES WERE SPECIFIED FOR  INPUT-CHAR-2


what do i need to change???
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Feb 24, 2009 6:02 pm
Reply with quote

1. subscript and index values of 0 are a no-no. the first occurance is 1.

2. what are the data descriptions of these fields?

3. we don't know if these are indexes or sub-scripts (ws-ind1, ws-ind2).

4. what is the definition of INPUT-CHAR-1 ? is it 3 char in length?
Back to top
View user's profile Send private message
Sudhanshu Shekhar

New User


Joined: 23 Jul 2008
Posts: 27
Location: City of Joy

PostPosted: Tue Feb 24, 2009 6:32 pm
Reply with quote

@dbz

sorry about that , i meant at the 1st occurence.

Currently its like this

Code:

INPUT-CHAR-1 OCCURS 25 TIMES INDEXED BY
    WS-IND1 PIC 99. 
INPUT-CHAR-2 OCCURS 25 TIMES INDEXED BY
    WS-IND2 PIC 99. 

       


and INPUT-CHAR-1 is pic X(01)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Feb 24, 2009 6:45 pm
Reply with quote

Quote:

and INPUT-CHAR-1 is pic X(01)



no it is not,
it is PIC 99 just like INPUT-CHAR-2.
Quote:

INPUT-CHAR-1 OCCURS 25 TIMES INDEXED BY
WS-IND1 PIC 99.



and we need the level numbers of the INPUT-CHAR-1/2 data definitions so that we can determine the cause of
Quote:
NOT ENOUGH SUBSCRIPTS OR INDICES WERE SPECIFIED FOR INPUT-CHAR-2
Back to top
View user's profile Send private message
Sudhanshu Shekhar

New User


Joined: 23 Jul 2008
Posts: 27
Location: City of Joy

PostPosted: Tue Feb 24, 2009 7:07 pm
Reply with quote

Hey thanks dbz

Your last input was very helpful ....

INPUT-CHAR1 was a table array DOUBLE OCCURS CLAUSE VARIABLE (LEVEL 15), WHILE I HAD DEFINED THE INPUT-CHAR2 WITH SINGLE OCCURS CLAUSE (LEVEL 10).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Feb 24, 2009 7:11 pm
Reply with quote

glad you were able to determine the problem and work on a solution.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top